Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [CN-IntegerUnlimited] >>> ***/ |
| 3 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 4 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 5 | |
| 6 | /*** <<< TYPE-DECLS [CN-IntegerUnlimited] >>> ***/ |
| 7 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 8 | typedef long CN_IntegerUnlimited_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 9 | |
| 10 | /*** <<< FUNC-DECLS [CN-IntegerUnlimited] >>> ***/ |
| 11 | |
| 12 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited; |
| 13 | asn_struct_free_f CN_IntegerUnlimited_free; |
| 14 | asn_struct_print_f CN_IntegerUnlimited_print; |
| 15 | asn_constr_check_f CN_IntegerUnlimited_constraint; |
| 16 | ber_type_decoder_f CN_IntegerUnlimited_decode_ber; |
| 17 | der_type_encoder_f CN_IntegerUnlimited_encode_der; |
| 18 | xer_type_decoder_f CN_IntegerUnlimited_decode_xer; |
| 19 | xer_type_encoder_f CN_IntegerUnlimited_encode_xer; |
| 20 | |
| 21 | /*** <<< CODE [CN-IntegerUnlimited] >>> ***/ |
| 22 | |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 23 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 24 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 25 | * so here we adjust the DEF accordingly. |
| 26 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 27 | |
| 28 | /*** <<< STAT-DEFS [CN-IntegerUnlimited] >>> ***/ |
| 29 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 30 | static const ber_tlv_tag_t asn_DEF_CN_IntegerUnlimited_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 31 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 32 | }; |
| 33 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerUnlimited = { |
| 34 | "CN-IntegerUnlimited", |
| 35 | "CN-IntegerUnlimited", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 36 | &asn_OP_NativeInteger, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 37 | NativeInteger_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 38 | asn_DEF_CN_IntegerUnlimited_tags_1, |
| 39 | sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) |
| 40 | /sizeof(asn_DEF_CN_IntegerUnlimited_tags_1[0]), /* 1 */ |
| 41 | asn_DEF_CN_IntegerUnlimited_tags_1, /* Same as above */ |
| 42 | sizeof(asn_DEF_CN_IntegerUnlimited_tags_1) |
| 43 | /sizeof(asn_DEF_CN_IntegerUnlimited_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 | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 46 | 0, 0, /* No members */ |
| 47 | 0 /* No specifics */ |
| 48 | }; |
| 49 | |
| 50 | |
| 51 | /*** <<< INCLUDES [CN-IntegerMinMax] >>> ***/ |
| 52 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 53 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 54 | |
| 55 | /*** <<< TYPE-DECLS [CN-IntegerMinMax] >>> ***/ |
| 56 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 57 | typedef long CN_IntegerMinMax_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 58 | |
| 59 | /*** <<< FUNC-DECLS [CN-IntegerMinMax] >>> ***/ |
| 60 | |
| 61 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax; |
| 62 | asn_struct_free_f CN_IntegerMinMax_free; |
| 63 | asn_struct_print_f CN_IntegerMinMax_print; |
| 64 | asn_constr_check_f CN_IntegerMinMax_constraint; |
| 65 | ber_type_decoder_f CN_IntegerMinMax_decode_ber; |
| 66 | der_type_encoder_f CN_IntegerMinMax_encode_der; |
| 67 | xer_type_decoder_f CN_IntegerMinMax_decode_xer; |
| 68 | xer_type_encoder_f CN_IntegerMinMax_encode_xer; |
| 69 | |
| 70 | /*** <<< CODE [CN-IntegerMinMax] >>> ***/ |
| 71 | |
| 72 | int |
| 73 | CN_IntegerMinMax_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 | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 75 | |
| 76 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 77 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 78 | "%s: value not given (%s:%d)", |
| 79 | td->name, __FILE__, __LINE__); |
| 80 | return -1; |
| 81 | } |
| 82 | |
| 83 | |
| 84 | if(1 /* No applicable constraints whatsoever */) { |
| 85 | /* Nothing is here. See below */ |
| 86 | } |
| 87 | |
| 88 | /* Replace with underlying type checker */ |
Lev Walkin | 154519a | 2017-09-06 23:34:40 -0700 | [diff] [blame] | 89 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 93 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 94 | * so here we adjust the DEF accordingly. |
| 95 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 96 | |
| 97 | /*** <<< STAT-DEFS [CN-IntegerMinMax] >>> ***/ |
| 98 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 99 | static const ber_tlv_tag_t asn_DEF_CN_IntegerMinMax_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 100 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 101 | }; |
| 102 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinMax = { |
| 103 | "CN-IntegerMinMax", |
| 104 | "CN-IntegerMinMax", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 105 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 106 | CN_IntegerMinMax_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 107 | asn_DEF_CN_IntegerMinMax_tags_1, |
| 108 | sizeof(asn_DEF_CN_IntegerMinMax_tags_1) |
| 109 | /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ |
| 110 | asn_DEF_CN_IntegerMinMax_tags_1, /* Same as above */ |
| 111 | sizeof(asn_DEF_CN_IntegerMinMax_tags_1) |
| 112 | /sizeof(asn_DEF_CN_IntegerMinMax_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 113 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 114 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 115 | 0, 0, /* No members */ |
| 116 | 0 /* No specifics */ |
| 117 | }; |
| 118 | |
| 119 | |
| 120 | /*** <<< INCLUDES [CN-IntegerMinLow] >>> ***/ |
| 121 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 122 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 123 | |
| 124 | /*** <<< TYPE-DECLS [CN-IntegerMinLow] >>> ***/ |
| 125 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 126 | typedef long CN_IntegerMinLow_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 127 | |
| 128 | /*** <<< FUNC-DECLS [CN-IntegerMinLow] >>> ***/ |
| 129 | |
| 130 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow; |
| 131 | asn_struct_free_f CN_IntegerMinLow_free; |
| 132 | asn_struct_print_f CN_IntegerMinLow_print; |
| 133 | asn_constr_check_f CN_IntegerMinLow_constraint; |
| 134 | ber_type_decoder_f CN_IntegerMinLow_decode_ber; |
| 135 | der_type_encoder_f CN_IntegerMinLow_encode_der; |
| 136 | xer_type_decoder_f CN_IntegerMinLow_decode_xer; |
| 137 | xer_type_encoder_f CN_IntegerMinLow_encode_xer; |
| 138 | |
| 139 | /*** <<< CODE [CN-IntegerMinLow] >>> ***/ |
| 140 | |
| 141 | int |
| 142 | CN_IntegerMinLow_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 143 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 144 | long value; |
| 145 | |
| 146 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 147 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 148 | "%s: value not given (%s:%d)", |
| 149 | td->name, __FILE__, __LINE__); |
| 150 | return -1; |
| 151 | } |
| 152 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 153 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 154 | |
| 155 | if((value <= 1)) { |
| 156 | /* Constraint check succeeded */ |
| 157 | return 0; |
| 158 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 159 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 160 | "%s: constraint failed (%s:%d)", |
| 161 | td->name, __FILE__, __LINE__); |
| 162 | return -1; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 167 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 168 | * so here we adjust the DEF accordingly. |
| 169 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 170 | |
| 171 | /*** <<< STAT-DEFS [CN-IntegerMinLow] >>> ***/ |
| 172 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 173 | static const ber_tlv_tag_t asn_DEF_CN_IntegerMinLow_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 174 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 175 | }; |
| 176 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerMinLow = { |
| 177 | "CN-IntegerMinLow", |
| 178 | "CN-IntegerMinLow", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 179 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 180 | CN_IntegerMinLow_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 181 | asn_DEF_CN_IntegerMinLow_tags_1, |
| 182 | sizeof(asn_DEF_CN_IntegerMinLow_tags_1) |
| 183 | /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ |
| 184 | asn_DEF_CN_IntegerMinLow_tags_1, /* Same as above */ |
| 185 | sizeof(asn_DEF_CN_IntegerMinLow_tags_1) |
| 186 | /sizeof(asn_DEF_CN_IntegerMinLow_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 187 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 188 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 189 | 0, 0, /* No members */ |
| 190 | 0 /* No specifics */ |
| 191 | }; |
| 192 | |
| 193 | |
| 194 | /*** <<< INCLUDES [NO-IntegerMinHigh] >>> ***/ |
| 195 | |
| 196 | #include <INTEGER.h> |
| 197 | |
| 198 | /*** <<< TYPE-DECLS [NO-IntegerMinHigh] >>> ***/ |
| 199 | |
| 200 | typedef INTEGER_t NO_IntegerMinHigh_t; |
| 201 | |
| 202 | /*** <<< FUNC-DECLS [NO-IntegerMinHigh] >>> ***/ |
| 203 | |
| 204 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh; |
| 205 | asn_struct_free_f NO_IntegerMinHigh_free; |
| 206 | asn_struct_print_f NO_IntegerMinHigh_print; |
| 207 | asn_constr_check_f NO_IntegerMinHigh_constraint; |
| 208 | ber_type_decoder_f NO_IntegerMinHigh_decode_ber; |
| 209 | der_type_encoder_f NO_IntegerMinHigh_encode_der; |
| 210 | xer_type_decoder_f NO_IntegerMinHigh_decode_xer; |
| 211 | xer_type_encoder_f NO_IntegerMinHigh_encode_xer; |
| 212 | |
| 213 | /*** <<< CODE [NO-IntegerMinHigh] >>> ***/ |
| 214 | |
| 215 | int |
| 216 | NO_IntegerMinHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 217 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 218 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 219 | long value; |
| 220 | |
| 221 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 222 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 223 | "%s: value not given (%s:%d)", |
| 224 | td->name, __FILE__, __LINE__); |
| 225 | return -1; |
| 226 | } |
| 227 | |
| 228 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 229 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 230 | "%s: value too large (%s:%d)", |
| 231 | td->name, __FILE__, __LINE__); |
| 232 | return -1; |
| 233 | } |
| 234 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 235 | if((value <= 3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 236 | /* Constraint check succeeded */ |
| 237 | return 0; |
| 238 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 239 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 240 | "%s: constraint failed (%s:%d)", |
| 241 | td->name, __FILE__, __LINE__); |
| 242 | return -1; |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | /* |
| 247 | * This type is implemented using INTEGER, |
| 248 | * so here we adjust the DEF accordingly. |
| 249 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 250 | |
| 251 | /*** <<< STAT-DEFS [NO-IntegerMinHigh] >>> ***/ |
| 252 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 253 | static const ber_tlv_tag_t asn_DEF_NO_IntegerMinHigh_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 254 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 255 | }; |
| 256 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerMinHigh = { |
| 257 | "NO-IntegerMinHigh", |
| 258 | "NO-IntegerMinHigh", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 259 | &asn_OP_INTEGER, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 260 | NO_IntegerMinHigh_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 261 | asn_DEF_NO_IntegerMinHigh_tags_1, |
| 262 | sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) |
| 263 | /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ |
| 264 | asn_DEF_NO_IntegerMinHigh_tags_1, /* Same as above */ |
| 265 | sizeof(asn_DEF_NO_IntegerMinHigh_tags_1) |
| 266 | /sizeof(asn_DEF_NO_IntegerMinHigh_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 267 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 268 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 269 | 0, 0, /* No members */ |
| 270 | 0 /* No specifics */ |
| 271 | }; |
| 272 | |
| 273 | |
| 274 | /*** <<< INCLUDES [NO-IntegerLowHigh] >>> ***/ |
| 275 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 276 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 277 | |
| 278 | /*** <<< TYPE-DECLS [NO-IntegerLowHigh] >>> ***/ |
| 279 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 280 | typedef unsigned long NO_IntegerLowHigh_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 281 | |
| 282 | /*** <<< FUNC-DECLS [NO-IntegerLowHigh] >>> ***/ |
| 283 | |
| 284 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh; |
| 285 | asn_struct_free_f NO_IntegerLowHigh_free; |
| 286 | asn_struct_print_f NO_IntegerLowHigh_print; |
| 287 | asn_constr_check_f NO_IntegerLowHigh_constraint; |
| 288 | ber_type_decoder_f NO_IntegerLowHigh_decode_ber; |
| 289 | der_type_encoder_f NO_IntegerLowHigh_encode_der; |
| 290 | xer_type_decoder_f NO_IntegerLowHigh_decode_xer; |
| 291 | xer_type_encoder_f NO_IntegerLowHigh_encode_xer; |
| 292 | |
| 293 | /*** <<< CODE [NO-IntegerLowHigh] >>> ***/ |
| 294 | |
| 295 | int |
| 296 | NO_IntegerLowHigh_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 297 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 298 | unsigned long value; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 299 | |
| 300 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 301 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 302 | "%s: value not given (%s:%d)", |
| 303 | td->name, __FILE__, __LINE__); |
| 304 | return -1; |
| 305 | } |
| 306 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 307 | value = *(const unsigned long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 308 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 309 | if((value >= 1 && value <= 3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 310 | /* Constraint check succeeded */ |
| 311 | return 0; |
| 312 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 313 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 314 | "%s: constraint failed (%s:%d)", |
| 315 | td->name, __FILE__, __LINE__); |
| 316 | return -1; |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | /* |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 321 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 322 | * so here we adjust the DEF accordingly. |
| 323 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 324 | |
| 325 | /*** <<< STAT-DEFS [NO-IntegerLowHigh] >>> ***/ |
| 326 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 327 | static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerLowHigh_specs_1 = { |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 328 | 0, 0, 0, 0, 0, |
| 329 | 0, /* Native long size */ |
| 330 | 1 /* Unsigned representation */ |
| 331 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 332 | static const ber_tlv_tag_t asn_DEF_NO_IntegerLowHigh_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 333 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 334 | }; |
| 335 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowHigh = { |
| 336 | "NO-IntegerLowHigh", |
| 337 | "NO-IntegerLowHigh", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 338 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 339 | NO_IntegerLowHigh_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 340 | asn_DEF_NO_IntegerLowHigh_tags_1, |
| 341 | sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) |
| 342 | /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ |
| 343 | asn_DEF_NO_IntegerLowHigh_tags_1, /* Same as above */ |
| 344 | sizeof(asn_DEF_NO_IntegerLowHigh_tags_1) |
| 345 | /sizeof(asn_DEF_NO_IntegerLowHigh_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 346 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 347 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 348 | 0, 0, /* No members */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 349 | &asn_SPC_NO_IntegerLowHigh_specs_1 /* Additional specs */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 350 | }; |
| 351 | |
| 352 | |
| 353 | /*** <<< INCLUDES [CN-IntegerLowMax] >>> ***/ |
| 354 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 355 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 356 | |
| 357 | /*** <<< TYPE-DECLS [CN-IntegerLowMax] >>> ***/ |
| 358 | |
Lev Walkin | e0f2a5b | 2017-08-30 20:02:29 -0700 | [diff] [blame] | 359 | typedef unsigned long CN_IntegerLowMax_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 360 | |
| 361 | /*** <<< FUNC-DECLS [CN-IntegerLowMax] >>> ***/ |
| 362 | |
| 363 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax; |
| 364 | asn_struct_free_f CN_IntegerLowMax_free; |
| 365 | asn_struct_print_f CN_IntegerLowMax_print; |
| 366 | asn_constr_check_f CN_IntegerLowMax_constraint; |
| 367 | ber_type_decoder_f CN_IntegerLowMax_decode_ber; |
| 368 | der_type_encoder_f CN_IntegerLowMax_encode_der; |
| 369 | xer_type_decoder_f CN_IntegerLowMax_decode_xer; |
| 370 | xer_type_encoder_f CN_IntegerLowMax_encode_xer; |
| 371 | |
| 372 | /*** <<< CODE [CN-IntegerLowMax] >>> ***/ |
| 373 | |
| 374 | int |
| 375 | CN_IntegerLowMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 376 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | e0f2a5b | 2017-08-30 20:02:29 -0700 | [diff] [blame] | 377 | unsigned long value; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 378 | |
| 379 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 380 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 381 | "%s: value not given (%s:%d)", |
| 382 | td->name, __FILE__, __LINE__); |
| 383 | return -1; |
| 384 | } |
| 385 | |
Lev Walkin | e0f2a5b | 2017-08-30 20:02:29 -0700 | [diff] [blame] | 386 | value = *(const unsigned long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 387 | |
| 388 | if((value >= 1)) { |
| 389 | /* Constraint check succeeded */ |
| 390 | return 0; |
| 391 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 392 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 393 | "%s: constraint failed (%s:%d)", |
| 394 | td->name, __FILE__, __LINE__); |
| 395 | return -1; |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 400 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 401 | * so here we adjust the DEF accordingly. |
| 402 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 403 | |
| 404 | /*** <<< STAT-DEFS [CN-IntegerLowMax] >>> ***/ |
| 405 | |
Lev Walkin | e0f2a5b | 2017-08-30 20:02:29 -0700 | [diff] [blame] | 406 | static const asn_INTEGER_specifics_t asn_SPC_CN_IntegerLowMax_specs_1 = { |
| 407 | 0, 0, 0, 0, 0, |
| 408 | 0, /* Native long size */ |
| 409 | 1 /* Unsigned representation */ |
| 410 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 411 | static const ber_tlv_tag_t asn_DEF_CN_IntegerLowMax_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 412 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 413 | }; |
| 414 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerLowMax = { |
| 415 | "CN-IntegerLowMax", |
| 416 | "CN-IntegerLowMax", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 417 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 418 | CN_IntegerLowMax_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 419 | asn_DEF_CN_IntegerLowMax_tags_1, |
| 420 | sizeof(asn_DEF_CN_IntegerLowMax_tags_1) |
| 421 | /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ |
| 422 | asn_DEF_CN_IntegerLowMax_tags_1, /* Same as above */ |
| 423 | sizeof(asn_DEF_CN_IntegerLowMax_tags_1) |
| 424 | /sizeof(asn_DEF_CN_IntegerLowMax_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 425 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 426 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 427 | 0, 0, /* No members */ |
Lev Walkin | e0f2a5b | 2017-08-30 20:02:29 -0700 | [diff] [blame] | 428 | &asn_SPC_CN_IntegerLowMax_specs_1 /* Additional specs */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 429 | }; |
| 430 | |
| 431 | |
| 432 | /*** <<< INCLUDES [NO-IntegerHighMax] >>> ***/ |
| 433 | |
| 434 | #include <INTEGER.h> |
| 435 | |
| 436 | /*** <<< TYPE-DECLS [NO-IntegerHighMax] >>> ***/ |
| 437 | |
| 438 | typedef INTEGER_t NO_IntegerHighMax_t; |
| 439 | |
| 440 | /*** <<< FUNC-DECLS [NO-IntegerHighMax] >>> ***/ |
| 441 | |
| 442 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax; |
| 443 | asn_struct_free_f NO_IntegerHighMax_free; |
| 444 | asn_struct_print_f NO_IntegerHighMax_print; |
| 445 | asn_constr_check_f NO_IntegerHighMax_constraint; |
| 446 | ber_type_decoder_f NO_IntegerHighMax_decode_ber; |
| 447 | der_type_encoder_f NO_IntegerHighMax_encode_der; |
| 448 | xer_type_decoder_f NO_IntegerHighMax_decode_xer; |
| 449 | xer_type_encoder_f NO_IntegerHighMax_encode_xer; |
| 450 | |
| 451 | /*** <<< CODE [NO-IntegerHighMax] >>> ***/ |
| 452 | |
| 453 | int |
| 454 | NO_IntegerHighMax_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 455 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 456 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 457 | long value; |
| 458 | |
| 459 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 460 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 461 | "%s: value not given (%s:%d)", |
| 462 | td->name, __FILE__, __LINE__); |
| 463 | return -1; |
| 464 | } |
| 465 | |
| 466 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 467 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 468 | "%s: value too large (%s:%d)", |
| 469 | td->name, __FILE__, __LINE__); |
| 470 | return -1; |
| 471 | } |
| 472 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 473 | if((value >= 3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 474 | /* Constraint check succeeded */ |
| 475 | return 0; |
| 476 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 477 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 478 | "%s: constraint failed (%s:%d)", |
| 479 | td->name, __FILE__, __LINE__); |
| 480 | return -1; |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | /* |
| 485 | * This type is implemented using INTEGER, |
| 486 | * so here we adjust the DEF accordingly. |
| 487 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 488 | |
| 489 | /*** <<< STAT-DEFS [NO-IntegerHighMax] >>> ***/ |
| 490 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 491 | static const ber_tlv_tag_t asn_DEF_NO_IntegerHighMax_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 492 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 493 | }; |
| 494 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerHighMax = { |
| 495 | "NO-IntegerHighMax", |
| 496 | "NO-IntegerHighMax", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 497 | &asn_OP_INTEGER, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 498 | NO_IntegerHighMax_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 499 | asn_DEF_NO_IntegerHighMax_tags_1, |
| 500 | sizeof(asn_DEF_NO_IntegerHighMax_tags_1) |
| 501 | /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ |
| 502 | asn_DEF_NO_IntegerHighMax_tags_1, /* Same as above */ |
| 503 | sizeof(asn_DEF_NO_IntegerHighMax_tags_1) |
| 504 | /sizeof(asn_DEF_NO_IntegerHighMax_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 505 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 506 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 507 | 0, 0, /* No members */ |
| 508 | 0 /* No specifics */ |
| 509 | }; |
| 510 | |
| 511 | |
| 512 | /*** <<< INCLUDES [NO-IntegerLowestMax] >>> ***/ |
| 513 | |
| 514 | #include <INTEGER.h> |
| 515 | |
| 516 | /*** <<< TYPE-DECLS [NO-IntegerLowestMax] >>> ***/ |
| 517 | |
| 518 | typedef INTEGER_t NO_IntegerLowestMax_t; |
| 519 | |
| 520 | /*** <<< FUNC-DECLS [NO-IntegerLowestMax] >>> ***/ |
| 521 | |
| 522 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax; |
| 523 | asn_struct_free_f NO_IntegerLowestMax_free; |
| 524 | asn_struct_print_f NO_IntegerLowestMax_print; |
| 525 | asn_constr_check_f NO_IntegerLowestMax_constraint; |
| 526 | ber_type_decoder_f NO_IntegerLowestMax_decode_ber; |
| 527 | der_type_encoder_f NO_IntegerLowestMax_encode_der; |
| 528 | xer_type_decoder_f NO_IntegerLowestMax_decode_xer; |
| 529 | xer_type_encoder_f NO_IntegerLowestMax_encode_xer; |
| 530 | |
| 531 | /*** <<< CODE [NO-IntegerLowestMax] >>> ***/ |
| 532 | |
| 533 | int |
| 534 | NO_IntegerLowestMax_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 | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 536 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 537 | long value; |
| 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 | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 541 | "%s: value not given (%s:%d)", |
| 542 | td->name, __FILE__, __LINE__); |
| 543 | return -1; |
| 544 | } |
| 545 | |
| 546 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 547 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 548 | "%s: value too large (%s:%d)", |
| 549 | td->name, __FILE__, __LINE__); |
| 550 | return -1; |
| 551 | } |
| 552 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 553 | if((value >= -3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 554 | /* Constraint check succeeded */ |
| 555 | return 0; |
| 556 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 557 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 558 | "%s: constraint failed (%s:%d)", |
| 559 | td->name, __FILE__, __LINE__); |
| 560 | return -1; |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | /* |
| 565 | * This type is implemented using INTEGER, |
| 566 | * so here we adjust the DEF accordingly. |
| 567 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 568 | |
| 569 | /*** <<< STAT-DEFS [NO-IntegerLowestMax] >>> ***/ |
| 570 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 571 | static const ber_tlv_tag_t asn_DEF_NO_IntegerLowestMax_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 572 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 573 | }; |
| 574 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerLowestMax = { |
| 575 | "NO-IntegerLowestMax", |
| 576 | "NO-IntegerLowestMax", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 577 | &asn_OP_INTEGER, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 578 | NO_IntegerLowestMax_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 579 | asn_DEF_NO_IntegerLowestMax_tags_1, |
| 580 | sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) |
| 581 | /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ |
| 582 | asn_DEF_NO_IntegerLowestMax_tags_1, /* Same as above */ |
| 583 | sizeof(asn_DEF_NO_IntegerLowestMax_tags_1) |
| 584 | /sizeof(asn_DEF_NO_IntegerLowestMax_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 585 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 586 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 587 | 0, 0, /* No members */ |
| 588 | 0 /* No specifics */ |
| 589 | }; |
| 590 | |
| 591 | |
| 592 | /*** <<< INCLUDES [NO-IntegerOutRange] >>> ***/ |
| 593 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 594 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 595 | |
| 596 | /*** <<< TYPE-DECLS [NO-IntegerOutRange] >>> ***/ |
| 597 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 598 | typedef unsigned long NO_IntegerOutRange_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 599 | |
| 600 | /*** <<< FUNC-DECLS [NO-IntegerOutRange] >>> ***/ |
| 601 | |
| 602 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange; |
| 603 | asn_struct_free_f NO_IntegerOutRange_free; |
| 604 | asn_struct_print_f NO_IntegerOutRange_print; |
| 605 | asn_constr_check_f NO_IntegerOutRange_constraint; |
| 606 | ber_type_decoder_f NO_IntegerOutRange_decode_ber; |
| 607 | der_type_encoder_f NO_IntegerOutRange_encode_der; |
| 608 | xer_type_decoder_f NO_IntegerOutRange_decode_xer; |
| 609 | xer_type_encoder_f NO_IntegerOutRange_encode_xer; |
| 610 | |
| 611 | /*** <<< CODE [NO-IntegerOutRange] >>> ***/ |
| 612 | |
| 613 | int |
| 614 | NO_IntegerOutRange_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 615 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 616 | unsigned long value; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 617 | |
| 618 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 619 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 620 | "%s: value not given (%s:%d)", |
| 621 | td->name, __FILE__, __LINE__); |
| 622 | return -1; |
| 623 | } |
| 624 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 625 | value = *(const unsigned long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 626 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 627 | if((value >= 3000000000 && value <= 3000000001)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 628 | /* Constraint check succeeded */ |
| 629 | return 0; |
| 630 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 631 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 632 | "%s: constraint failed (%s:%d)", |
| 633 | td->name, __FILE__, __LINE__); |
| 634 | return -1; |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | /* |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 639 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 640 | * so here we adjust the DEF accordingly. |
| 641 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 642 | |
| 643 | /*** <<< STAT-DEFS [NO-IntegerOutRange] >>> ***/ |
| 644 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 645 | static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutRange_specs_1 = { |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 646 | 0, 0, 0, 0, 0, |
| 647 | 0, /* Native long size */ |
| 648 | 1 /* Unsigned representation */ |
| 649 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 650 | static const ber_tlv_tag_t asn_DEF_NO_IntegerOutRange_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 651 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 652 | }; |
| 653 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutRange = { |
| 654 | "NO-IntegerOutRange", |
| 655 | "NO-IntegerOutRange", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 656 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 657 | NO_IntegerOutRange_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 658 | asn_DEF_NO_IntegerOutRange_tags_1, |
| 659 | sizeof(asn_DEF_NO_IntegerOutRange_tags_1) |
| 660 | /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ |
| 661 | asn_DEF_NO_IntegerOutRange_tags_1, /* Same as above */ |
| 662 | sizeof(asn_DEF_NO_IntegerOutRange_tags_1) |
| 663 | /sizeof(asn_DEF_NO_IntegerOutRange_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 664 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 665 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 666 | 0, 0, /* No members */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 667 | &asn_SPC_NO_IntegerOutRange_specs_1 /* Additional specs */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 668 | }; |
| 669 | |
| 670 | |
| 671 | /*** <<< INCLUDES [NO-IntegerOutValue] >>> ***/ |
| 672 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 673 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 674 | |
| 675 | /*** <<< TYPE-DECLS [NO-IntegerOutValue] >>> ***/ |
| 676 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 677 | typedef unsigned long NO_IntegerOutValue_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 678 | |
| 679 | /*** <<< FUNC-DECLS [NO-IntegerOutValue] >>> ***/ |
| 680 | |
| 681 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue; |
| 682 | asn_struct_free_f NO_IntegerOutValue_free; |
| 683 | asn_struct_print_f NO_IntegerOutValue_print; |
| 684 | asn_constr_check_f NO_IntegerOutValue_constraint; |
| 685 | ber_type_decoder_f NO_IntegerOutValue_decode_ber; |
| 686 | der_type_encoder_f NO_IntegerOutValue_encode_der; |
| 687 | xer_type_decoder_f NO_IntegerOutValue_decode_xer; |
| 688 | xer_type_encoder_f NO_IntegerOutValue_encode_xer; |
| 689 | |
| 690 | /*** <<< CODE [NO-IntegerOutValue] >>> ***/ |
| 691 | |
| 692 | int |
| 693 | NO_IntegerOutValue_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 694 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 695 | unsigned long value; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 696 | |
| 697 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 698 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 699 | "%s: value not given (%s:%d)", |
| 700 | td->name, __FILE__, __LINE__); |
| 701 | return -1; |
| 702 | } |
| 703 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 704 | value = *(const unsigned long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 705 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 706 | if((value == 3000000000)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 707 | /* Constraint check succeeded */ |
| 708 | return 0; |
| 709 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 710 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 711 | "%s: constraint failed (%s:%d)", |
| 712 | td->name, __FILE__, __LINE__); |
| 713 | return -1; |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | /* |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 718 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 719 | * so here we adjust the DEF accordingly. |
| 720 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 721 | |
| 722 | /*** <<< STAT-DEFS [NO-IntegerOutValue] >>> ***/ |
| 723 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 724 | static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerOutValue_specs_1 = { |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 725 | 0, 0, 0, 0, 0, |
| 726 | 0, /* Native long size */ |
| 727 | 1 /* Unsigned representation */ |
| 728 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 729 | static const ber_tlv_tag_t asn_DEF_NO_IntegerOutValue_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 730 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 731 | }; |
| 732 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerOutValue = { |
| 733 | "NO-IntegerOutValue", |
| 734 | "NO-IntegerOutValue", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 735 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 736 | NO_IntegerOutValue_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 737 | asn_DEF_NO_IntegerOutValue_tags_1, |
| 738 | sizeof(asn_DEF_NO_IntegerOutValue_tags_1) |
| 739 | /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ |
| 740 | asn_DEF_NO_IntegerOutValue_tags_1, /* Same as above */ |
| 741 | sizeof(asn_DEF_NO_IntegerOutValue_tags_1) |
| 742 | /sizeof(asn_DEF_NO_IntegerOutValue_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 743 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 744 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 745 | 0, 0, /* No members */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 746 | &asn_SPC_NO_IntegerOutValue_specs_1 /* Additional specs */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 747 | }; |
| 748 | |
| 749 | |
| 750 | /*** <<< INCLUDES [OK-IntegerInRange1] >>> ***/ |
| 751 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 752 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 753 | |
| 754 | /*** <<< TYPE-DECLS [OK-IntegerInRange1] >>> ***/ |
| 755 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 756 | typedef long OK_IntegerInRange1_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 757 | |
| 758 | /*** <<< FUNC-DECLS [OK-IntegerInRange1] >>> ***/ |
| 759 | |
| 760 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1; |
| 761 | asn_struct_free_f OK_IntegerInRange1_free; |
| 762 | asn_struct_print_f OK_IntegerInRange1_print; |
| 763 | asn_constr_check_f OK_IntegerInRange1_constraint; |
| 764 | ber_type_decoder_f OK_IntegerInRange1_decode_ber; |
| 765 | der_type_encoder_f OK_IntegerInRange1_encode_der; |
| 766 | xer_type_decoder_f OK_IntegerInRange1_decode_xer; |
| 767 | xer_type_encoder_f OK_IntegerInRange1_encode_xer; |
| 768 | |
| 769 | /*** <<< CODE [OK-IntegerInRange1] >>> ***/ |
| 770 | |
| 771 | int |
| 772 | OK_IntegerInRange1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 773 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 774 | long value; |
| 775 | |
| 776 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 777 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 778 | "%s: value not given (%s:%d)", |
| 779 | td->name, __FILE__, __LINE__); |
| 780 | return -1; |
| 781 | } |
| 782 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 783 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 784 | |
| 785 | if((value >= -100 && value <= 100)) { |
| 786 | /* Constraint check succeeded */ |
| 787 | return 0; |
| 788 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 789 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 790 | "%s: constraint failed (%s:%d)", |
| 791 | td->name, __FILE__, __LINE__); |
| 792 | return -1; |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 797 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 798 | * so here we adjust the DEF accordingly. |
| 799 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 800 | |
| 801 | /*** <<< STAT-DEFS [OK-IntegerInRange1] >>> ***/ |
| 802 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 803 | static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange1_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 804 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 805 | }; |
| 806 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange1 = { |
| 807 | "OK-IntegerInRange1", |
| 808 | "OK-IntegerInRange1", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 809 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 810 | OK_IntegerInRange1_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 811 | asn_DEF_OK_IntegerInRange1_tags_1, |
| 812 | sizeof(asn_DEF_OK_IntegerInRange1_tags_1) |
| 813 | /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ |
| 814 | asn_DEF_OK_IntegerInRange1_tags_1, /* Same as above */ |
| 815 | sizeof(asn_DEF_OK_IntegerInRange1_tags_1) |
| 816 | /sizeof(asn_DEF_OK_IntegerInRange1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 817 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 818 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 819 | 0, 0, /* No members */ |
| 820 | 0 /* No specifics */ |
| 821 | }; |
| 822 | |
| 823 | |
| 824 | /*** <<< INCLUDES [OK-IntegerInRange2] >>> ***/ |
| 825 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 826 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 827 | |
| 828 | /*** <<< TYPE-DECLS [OK-IntegerInRange2] >>> ***/ |
| 829 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 830 | typedef long OK_IntegerInRange2_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 831 | |
| 832 | /*** <<< FUNC-DECLS [OK-IntegerInRange2] >>> ***/ |
| 833 | |
| 834 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2; |
| 835 | asn_struct_free_f OK_IntegerInRange2_free; |
| 836 | asn_struct_print_f OK_IntegerInRange2_print; |
| 837 | asn_constr_check_f OK_IntegerInRange2_constraint; |
| 838 | ber_type_decoder_f OK_IntegerInRange2_decode_ber; |
| 839 | der_type_encoder_f OK_IntegerInRange2_encode_der; |
| 840 | xer_type_decoder_f OK_IntegerInRange2_decode_xer; |
| 841 | xer_type_encoder_f OK_IntegerInRange2_encode_xer; |
| 842 | |
| 843 | /*** <<< CODE [OK-IntegerInRange2] >>> ***/ |
| 844 | |
| 845 | int |
| 846 | OK_IntegerInRange2_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 847 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 848 | long value; |
| 849 | |
| 850 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 851 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 852 | "%s: value not given (%s:%d)", |
| 853 | td->name, __FILE__, __LINE__); |
| 854 | return -1; |
| 855 | } |
| 856 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 857 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 858 | |
| 859 | if(((value == -100) || (value == 100))) { |
| 860 | /* Constraint check succeeded */ |
| 861 | return 0; |
| 862 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 863 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 864 | "%s: constraint failed (%s:%d)", |
| 865 | td->name, __FILE__, __LINE__); |
| 866 | return -1; |
| 867 | } |
| 868 | } |
| 869 | |
| 870 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 871 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 872 | * so here we adjust the DEF accordingly. |
| 873 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 874 | |
| 875 | /*** <<< STAT-DEFS [OK-IntegerInRange2] >>> ***/ |
| 876 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 877 | static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange2_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 878 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 879 | }; |
| 880 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange2 = { |
| 881 | "OK-IntegerInRange2", |
| 882 | "OK-IntegerInRange2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 883 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 884 | OK_IntegerInRange2_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 885 | asn_DEF_OK_IntegerInRange2_tags_1, |
| 886 | sizeof(asn_DEF_OK_IntegerInRange2_tags_1) |
| 887 | /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ |
| 888 | asn_DEF_OK_IntegerInRange2_tags_1, /* Same as above */ |
| 889 | sizeof(asn_DEF_OK_IntegerInRange2_tags_1) |
| 890 | /sizeof(asn_DEF_OK_IntegerInRange2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 891 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 892 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 893 | 0, 0, /* No members */ |
| 894 | 0 /* No specifics */ |
| 895 | }; |
| 896 | |
| 897 | |
| 898 | /*** <<< INCLUDES [OK-IntegerInRange3] >>> ***/ |
| 899 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 900 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 901 | |
| 902 | /*** <<< TYPE-DECLS [OK-IntegerInRange3] >>> ***/ |
| 903 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 904 | typedef long OK_IntegerInRange3_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 905 | |
| 906 | /*** <<< FUNC-DECLS [OK-IntegerInRange3] >>> ***/ |
| 907 | |
| 908 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3; |
| 909 | asn_struct_free_f OK_IntegerInRange3_free; |
| 910 | asn_struct_print_f OK_IntegerInRange3_print; |
| 911 | asn_constr_check_f OK_IntegerInRange3_constraint; |
| 912 | ber_type_decoder_f OK_IntegerInRange3_decode_ber; |
| 913 | der_type_encoder_f OK_IntegerInRange3_encode_der; |
| 914 | xer_type_decoder_f OK_IntegerInRange3_decode_xer; |
| 915 | xer_type_encoder_f OK_IntegerInRange3_encode_xer; |
| 916 | |
| 917 | /*** <<< CODE [OK-IntegerInRange3] >>> ***/ |
| 918 | |
| 919 | int |
| 920 | OK_IntegerInRange3_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 921 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 922 | long value; |
| 923 | |
| 924 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 925 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 926 | "%s: value not given (%s:%d)", |
| 927 | td->name, __FILE__, __LINE__); |
| 928 | return -1; |
| 929 | } |
| 930 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 931 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 932 | |
Lev Walkin | 63b4126 | 2007-11-06 01:48:46 +0000 | [diff] [blame] | 933 | if((value >= (-2147483647L - 1) && value <= 2147483647)) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 934 | /* Constraint check succeeded */ |
| 935 | return 0; |
| 936 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 937 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 938 | "%s: constraint failed (%s:%d)", |
| 939 | td->name, __FILE__, __LINE__); |
| 940 | return -1; |
| 941 | } |
| 942 | } |
| 943 | |
| 944 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 945 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 946 | * so here we adjust the DEF accordingly. |
| 947 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 948 | |
| 949 | /*** <<< STAT-DEFS [OK-IntegerInRange3] >>> ***/ |
| 950 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 951 | static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange3_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 952 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 953 | }; |
| 954 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange3 = { |
| 955 | "OK-IntegerInRange3", |
| 956 | "OK-IntegerInRange3", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 957 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 958 | OK_IntegerInRange3_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 959 | asn_DEF_OK_IntegerInRange3_tags_1, |
| 960 | sizeof(asn_DEF_OK_IntegerInRange3_tags_1) |
| 961 | /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ |
| 962 | asn_DEF_OK_IntegerInRange3_tags_1, /* Same as above */ |
| 963 | sizeof(asn_DEF_OK_IntegerInRange3_tags_1) |
| 964 | /sizeof(asn_DEF_OK_IntegerInRange3_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 965 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 966 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 967 | 0, 0, /* No members */ |
| 968 | 0 /* No specifics */ |
| 969 | }; |
| 970 | |
| 971 | |
| 972 | /*** <<< INCLUDES [OK-IntegerInRange4] >>> ***/ |
| 973 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 974 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 975 | |
| 976 | /*** <<< TYPE-DECLS [OK-IntegerInRange4] >>> ***/ |
| 977 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 978 | typedef long OK_IntegerInRange4_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 979 | |
| 980 | /*** <<< FUNC-DECLS [OK-IntegerInRange4] >>> ***/ |
| 981 | |
| 982 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4; |
| 983 | asn_struct_free_f OK_IntegerInRange4_free; |
| 984 | asn_struct_print_f OK_IntegerInRange4_print; |
| 985 | asn_constr_check_f OK_IntegerInRange4_constraint; |
| 986 | ber_type_decoder_f OK_IntegerInRange4_decode_ber; |
| 987 | der_type_encoder_f OK_IntegerInRange4_encode_der; |
| 988 | xer_type_decoder_f OK_IntegerInRange4_decode_xer; |
| 989 | xer_type_encoder_f OK_IntegerInRange4_encode_xer; |
| 990 | |
| 991 | /*** <<< CODE [OK-IntegerInRange4] >>> ***/ |
| 992 | |
| 993 | int |
| 994 | OK_IntegerInRange4_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 995 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 996 | long value; |
| 997 | |
| 998 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 999 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1000 | "%s: value not given (%s:%d)", |
| 1001 | td->name, __FILE__, __LINE__); |
| 1002 | return -1; |
| 1003 | } |
| 1004 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1005 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1006 | |
Lev Walkin | 63b4126 | 2007-11-06 01:48:46 +0000 | [diff] [blame] | 1007 | if(((value == (-2147483647L - 1)) || (value == 2147483647))) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1008 | /* Constraint check succeeded */ |
| 1009 | return 0; |
| 1010 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1011 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1012 | "%s: constraint failed (%s:%d)", |
| 1013 | td->name, __FILE__, __LINE__); |
| 1014 | return -1; |
| 1015 | } |
| 1016 | } |
| 1017 | |
| 1018 | /* |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1019 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1020 | * so here we adjust the DEF accordingly. |
| 1021 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1022 | |
| 1023 | /*** <<< STAT-DEFS [OK-IntegerInRange4] >>> ***/ |
| 1024 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1025 | static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange4_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1026 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1027 | }; |
| 1028 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange4 = { |
| 1029 | "OK-IntegerInRange4", |
| 1030 | "OK-IntegerInRange4", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1031 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1032 | OK_IntegerInRange4_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1033 | asn_DEF_OK_IntegerInRange4_tags_1, |
| 1034 | sizeof(asn_DEF_OK_IntegerInRange4_tags_1) |
| 1035 | /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ |
| 1036 | asn_DEF_OK_IntegerInRange4_tags_1, /* Same as above */ |
| 1037 | sizeof(asn_DEF_OK_IntegerInRange4_tags_1) |
| 1038 | /sizeof(asn_DEF_OK_IntegerInRange4_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1039 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1040 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1041 | 0, 0, /* No members */ |
| 1042 | 0 /* No specifics */ |
| 1043 | }; |
| 1044 | |
| 1045 | |
| 1046 | /*** <<< INCLUDES [OK-IntegerInRange5] >>> ***/ |
| 1047 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 1048 | #include <NativeInteger.h> |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1049 | |
| 1050 | /*** <<< TYPE-DECLS [OK-IntegerInRange5] >>> ***/ |
| 1051 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 1052 | typedef long OK_IntegerInRange5_t; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1053 | |
| 1054 | /*** <<< FUNC-DECLS [OK-IntegerInRange5] >>> ***/ |
| 1055 | |
| 1056 | extern asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5; |
| 1057 | asn_struct_free_f OK_IntegerInRange5_free; |
| 1058 | asn_struct_print_f OK_IntegerInRange5_print; |
| 1059 | asn_constr_check_f OK_IntegerInRange5_constraint; |
| 1060 | ber_type_decoder_f OK_IntegerInRange5_decode_ber; |
| 1061 | der_type_encoder_f OK_IntegerInRange5_encode_der; |
| 1062 | xer_type_decoder_f OK_IntegerInRange5_decode_xer; |
| 1063 | xer_type_encoder_f OK_IntegerInRange5_encode_xer; |
| 1064 | |
| 1065 | /*** <<< CODE [OK-IntegerInRange5] >>> ***/ |
| 1066 | |
| 1067 | int |
| 1068 | OK_IntegerInRange5_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1069 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1070 | long value; |
| 1071 | |
| 1072 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1073 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1074 | "%s: value not given (%s:%d)", |
| 1075 | td->name, __FILE__, __LINE__); |
| 1076 | return -1; |
| 1077 | } |
| 1078 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 1079 | value = *(const long *)sptr; |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1080 | |
Lev Walkin | 63b4126 | 2007-11-06 01:48:46 +0000 | [diff] [blame] | 1081 | if(((value == (-2147483647L - 1)) || (value == 2147483647))) { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1082 | /* Constraint check succeeded */ |
| 1083 | return 0; |
| 1084 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1085 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1086 | "%s: constraint failed (%s:%d)", |
| 1087 | td->name, __FILE__, __LINE__); |
| 1088 | return -1; |
| 1089 | } |
| 1090 | } |
| 1091 | |
| 1092 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 1093 | * This type is implemented using NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1094 | * so here we adjust the DEF accordingly. |
| 1095 | */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1096 | |
| 1097 | /*** <<< STAT-DEFS [OK-IntegerInRange5] >>> ***/ |
| 1098 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1099 | static const ber_tlv_tag_t asn_DEF_OK_IntegerInRange5_tags_1[] = { |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1100 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1101 | }; |
| 1102 | asn_TYPE_descriptor_t asn_DEF_OK_IntegerInRange5 = { |
| 1103 | "OK-IntegerInRange5", |
| 1104 | "OK-IntegerInRange5", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1105 | &asn_OP_NativeInteger, |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1106 | OK_IntegerInRange5_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1107 | asn_DEF_OK_IntegerInRange5_tags_1, |
| 1108 | sizeof(asn_DEF_OK_IntegerInRange5_tags_1) |
| 1109 | /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ |
| 1110 | asn_DEF_OK_IntegerInRange5_tags_1, /* Same as above */ |
| 1111 | sizeof(asn_DEF_OK_IntegerInRange5_tags_1) |
| 1112 | /sizeof(asn_DEF_OK_IntegerInRange5_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1113 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1114 | 0, /* No PER visible constraints */ |
Lev Walkin | 082cadc | 2005-08-14 02:18:27 +0000 | [diff] [blame] | 1115 | 0, 0, /* No members */ |
| 1116 | 0 /* No specifics */ |
| 1117 | }; |
| 1118 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1119 | |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1120 | /*** <<< INCLUDES [NO-IntegerInRange6] >>> ***/ |
| 1121 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 1122 | #include <NativeInteger.h> |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1123 | |
| 1124 | /*** <<< TYPE-DECLS [NO-IntegerInRange6] >>> ***/ |
| 1125 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 1126 | typedef unsigned long NO_IntegerInRange6_t; |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1127 | |
| 1128 | /*** <<< FUNC-DECLS [NO-IntegerInRange6] >>> ***/ |
| 1129 | |
| 1130 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6; |
| 1131 | asn_struct_free_f NO_IntegerInRange6_free; |
| 1132 | asn_struct_print_f NO_IntegerInRange6_print; |
| 1133 | asn_constr_check_f NO_IntegerInRange6_constraint; |
| 1134 | ber_type_decoder_f NO_IntegerInRange6_decode_ber; |
| 1135 | der_type_encoder_f NO_IntegerInRange6_encode_der; |
| 1136 | xer_type_decoder_f NO_IntegerInRange6_decode_xer; |
| 1137 | xer_type_encoder_f NO_IntegerInRange6_encode_xer; |
| 1138 | |
| 1139 | /*** <<< CODE [NO-IntegerInRange6] >>> ***/ |
| 1140 | |
| 1141 | int |
| 1142 | NO_IntegerInRange6_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 1143 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1144 | |
| 1145 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 1146 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1147 | "%s: value not given (%s:%d)", |
| 1148 | td->name, __FILE__, __LINE__); |
| 1149 | return -1; |
| 1150 | } |
| 1151 | |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1152 | |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 1153 | /* Constraint check succeeded */ |
| 1154 | return 0; |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1155 | } |
| 1156 | |
| 1157 | /* |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 1158 | * This type is implemented using NativeInteger, |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1159 | * so here we adjust the DEF accordingly. |
| 1160 | */ |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1161 | |
| 1162 | /*** <<< STAT-DEFS [NO-IntegerInRange6] >>> ***/ |
| 1163 | |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 1164 | static const asn_INTEGER_specifics_t asn_SPC_NO_IntegerInRange6_specs_1 = { |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 1165 | 0, 0, 0, 0, 0, |
| 1166 | 0, /* Native long size */ |
| 1167 | 1 /* Unsigned representation */ |
| 1168 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1169 | static const ber_tlv_tag_t asn_DEF_NO_IntegerInRange6_tags_1[] = { |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1170 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1171 | }; |
| 1172 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerInRange6 = { |
| 1173 | "NO-IntegerInRange6", |
| 1174 | "NO-IntegerInRange6", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1175 | &asn_OP_NativeInteger, |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1176 | NO_IntegerInRange6_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1177 | asn_DEF_NO_IntegerInRange6_tags_1, |
| 1178 | sizeof(asn_DEF_NO_IntegerInRange6_tags_1) |
| 1179 | /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ |
| 1180 | asn_DEF_NO_IntegerInRange6_tags_1, /* Same as above */ |
| 1181 | sizeof(asn_DEF_NO_IntegerInRange6_tags_1) |
| 1182 | /sizeof(asn_DEF_NO_IntegerInRange6_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1183 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1184 | 0, /* No PER visible constraints */ |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1185 | 0, 0, /* No members */ |
Lev Walkin | 8bb57a2 | 2007-12-03 13:41:36 +0000 | [diff] [blame] | 1186 | &asn_SPC_NO_IntegerInRange6_specs_1 /* Additional specs */ |
Lev Walkin | fee6f71 | 2005-08-27 03:13:51 +0000 | [diff] [blame] | 1187 | }; |
| 1188 | |
| 1189 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1190 | /*** <<< INCLUDES [CN-IntegerEnumerated1] >>> ***/ |
| 1191 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 1192 | #include <NativeInteger.h> |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1193 | |
| 1194 | /*** <<< DEPS [CN-IntegerEnumerated1] >>> ***/ |
| 1195 | |
| 1196 | typedef enum CN_IntegerEnumerated1 { |
| 1197 | CN_IntegerEnumerated1_a = 1, |
| 1198 | CN_IntegerEnumerated1_b = 2 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 1199 | } e_CN_IntegerEnumerated1; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1200 | |
| 1201 | /*** <<< TYPE-DECLS [CN-IntegerEnumerated1] >>> ***/ |
| 1202 | |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 1203 | typedef long CN_IntegerEnumerated1_t; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1204 | |
| 1205 | /*** <<< FUNC-DECLS [CN-IntegerEnumerated1] >>> ***/ |
| 1206 | |
| 1207 | extern asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1; |
| 1208 | asn_struct_free_f CN_IntegerEnumerated1_free; |
| 1209 | asn_struct_print_f CN_IntegerEnumerated1_print; |
| 1210 | asn_constr_check_f CN_IntegerEnumerated1_constraint; |
| 1211 | ber_type_decoder_f CN_IntegerEnumerated1_decode_ber; |
| 1212 | der_type_encoder_f CN_IntegerEnumerated1_encode_der; |
| 1213 | xer_type_decoder_f CN_IntegerEnumerated1_decode_xer; |
| 1214 | xer_type_encoder_f CN_IntegerEnumerated1_encode_xer; |
| 1215 | |
| 1216 | /*** <<< CODE [CN-IntegerEnumerated1] >>> ***/ |
| 1217 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1218 | /* |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 1219 | * This type is implemented using NativeInteger, |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1220 | * so here we adjust the DEF accordingly. |
| 1221 | */ |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1222 | |
| 1223 | /*** <<< STAT-DEFS [CN-IntegerEnumerated1] >>> ***/ |
| 1224 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1225 | static const ber_tlv_tag_t asn_DEF_CN_IntegerEnumerated1_tags_1[] = { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1226 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1227 | }; |
| 1228 | asn_TYPE_descriptor_t asn_DEF_CN_IntegerEnumerated1 = { |
| 1229 | "CN-IntegerEnumerated1", |
| 1230 | "CN-IntegerEnumerated1", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1231 | &asn_OP_NativeInteger, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 1232 | NativeInteger_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1233 | asn_DEF_CN_IntegerEnumerated1_tags_1, |
| 1234 | sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) |
| 1235 | /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ |
| 1236 | asn_DEF_CN_IntegerEnumerated1_tags_1, /* Same as above */ |
| 1237 | sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1) |
| 1238 | /sizeof(asn_DEF_CN_IntegerEnumerated1_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1239 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1240 | 0, /* No PER visible constraints */ |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1241 | 0, 0, /* Defined elsewhere */ |
| 1242 | 0 /* No specifics */ |
| 1243 | }; |
| 1244 | |
| 1245 | |
| 1246 | /*** <<< INCLUDES [NO-IntegerEnumerated2] >>> ***/ |
| 1247 | |
| 1248 | #include <INTEGER.h> |
| 1249 | |
| 1250 | /*** <<< DEPS [NO-IntegerEnumerated2] >>> ***/ |
| 1251 | |
| 1252 | typedef enum NO_IntegerEnumerated2 { |
| 1253 | NO_IntegerEnumerated2_a = 1, |
| 1254 | NO_IntegerEnumerated2_b = 3000000000 |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 1255 | } e_NO_IntegerEnumerated2; |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1256 | |
| 1257 | /*** <<< TYPE-DECLS [NO-IntegerEnumerated2] >>> ***/ |
| 1258 | |
| 1259 | typedef INTEGER_t NO_IntegerEnumerated2_t; |
| 1260 | |
| 1261 | /*** <<< FUNC-DECLS [NO-IntegerEnumerated2] >>> ***/ |
| 1262 | |
| 1263 | extern asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2; |
| 1264 | asn_struct_free_f NO_IntegerEnumerated2_free; |
| 1265 | asn_struct_print_f NO_IntegerEnumerated2_print; |
| 1266 | asn_constr_check_f NO_IntegerEnumerated2_constraint; |
| 1267 | ber_type_decoder_f NO_IntegerEnumerated2_decode_ber; |
| 1268 | der_type_encoder_f NO_IntegerEnumerated2_encode_der; |
| 1269 | xer_type_decoder_f NO_IntegerEnumerated2_decode_xer; |
| 1270 | xer_type_encoder_f NO_IntegerEnumerated2_encode_xer; |
| 1271 | |
| 1272 | /*** <<< CODE [NO-IntegerEnumerated2] >>> ***/ |
| 1273 | |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1274 | /* |
| 1275 | * This type is implemented using INTEGER, |
| 1276 | * so here we adjust the DEF accordingly. |
| 1277 | */ |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1278 | |
| 1279 | /*** <<< STAT-DEFS [NO-IntegerEnumerated2] >>> ***/ |
| 1280 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 1281 | static const ber_tlv_tag_t asn_DEF_NO_IntegerEnumerated2_tags_1[] = { |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1282 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 1283 | }; |
| 1284 | asn_TYPE_descriptor_t asn_DEF_NO_IntegerEnumerated2 = { |
| 1285 | "NO-IntegerEnumerated2", |
| 1286 | "NO-IntegerEnumerated2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 1287 | &asn_OP_INTEGER, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 1288 | INTEGER_constraint, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1289 | asn_DEF_NO_IntegerEnumerated2_tags_1, |
| 1290 | sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) |
| 1291 | /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ |
| 1292 | asn_DEF_NO_IntegerEnumerated2_tags_1, /* Same as above */ |
| 1293 | sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1) |
| 1294 | /sizeof(asn_DEF_NO_IntegerEnumerated2_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 1295 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1296 | 0, /* No PER visible constraints */ |
Lev Walkin | c3f0b89 | 2005-08-14 02:40:04 +0000 | [diff] [blame] | 1297 | 0, 0, /* Defined elsewhere */ |
| 1298 | 0 /* No specifics */ |
| 1299 | }; |
| 1300 | |