Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [MinMax] >>> ***/ |
| 3 | |
| 4 | #include <INTEGER.h> |
| 5 | |
| 6 | /*** <<< TYPE-DECLS [MinMax] >>> ***/ |
| 7 | |
| 8 | typedef INTEGER_t MinMax_16P0_t; |
| 9 | |
| 10 | /*** <<< FUNC-DECLS [MinMax] >>> ***/ |
| 11 | |
| 12 | extern asn_TYPE_descriptor_t asn_DEF_MinMax_16P0; |
| 13 | asn_struct_free_f MinMax_16P0_free; |
| 14 | asn_struct_print_f MinMax_16P0_print; |
| 15 | asn_constr_check_f MinMax_16P0_constraint; |
| 16 | ber_type_decoder_f MinMax_16P0_decode_ber; |
| 17 | der_type_encoder_f MinMax_16P0_encode_der; |
| 18 | xer_type_decoder_f MinMax_16P0_decode_xer; |
| 19 | xer_type_encoder_f MinMax_16P0_encode_xer; |
| 20 | |
| 21 | /*** <<< CODE [MinMax] >>> ***/ |
| 22 | |
| 23 | int |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 24 | MinMax_16P0_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 25 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 26 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 27 | long value; |
| 28 | |
| 29 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 30 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 31 | "%s: value not given (%s:%d)", |
| 32 | td->name, __FILE__, __LINE__); |
| 33 | return -1; |
| 34 | } |
| 35 | |
| 36 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 37 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 38 | "%s: value too large (%s:%d)", |
| 39 | td->name, __FILE__, __LINE__); |
| 40 | return -1; |
| 41 | } |
| 42 | |
| 43 | if((value >= 3)) { |
| 44 | /* Constraint check succeeded */ |
| 45 | return 0; |
| 46 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 47 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 48 | "%s: constraint failed (%s:%d)", |
| 49 | td->name, __FILE__, __LINE__); |
| 50 | return -1; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /* |
| 55 | * This type is implemented using INTEGER, |
| 56 | * so here we adjust the DEF accordingly. |
| 57 | */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 58 | |
| 59 | /*** <<< STAT-DEFS [MinMax] >>> ***/ |
| 60 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 61 | static const ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 62 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 63 | }; |
| 64 | asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = { |
| 65 | "MinMax", |
| 66 | "MinMax", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 67 | &asn_OP_INTEGER, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 68 | asn_DEF_MinMax_16P0_tags_1, |
| 69 | sizeof(asn_DEF_MinMax_16P0_tags_1) |
| 70 | /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ |
| 71 | asn_DEF_MinMax_16P0_tags_1, /* Same as above */ |
| 72 | sizeof(asn_DEF_MinMax_16P0_tags_1) |
| 73 | /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 74 | { 0, 0, MinMax_16P0_constraint }, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 75 | 0, 0, /* No members */ |
| 76 | 0 /* No specifics */ |
| 77 | }; |
| 78 | |
| 79 | |
| 80 | /*** <<< INCLUDES [ThreePlus] >>> ***/ |
| 81 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 82 | #include "MinMax.h" |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 83 | |
| 84 | /*** <<< TYPE-DECLS [ThreePlus] >>> ***/ |
| 85 | |
| 86 | typedef MinMax_16P0_t ThreePlus_t; |
| 87 | |
| 88 | /*** <<< FUNC-DECLS [ThreePlus] >>> ***/ |
| 89 | |
| 90 | extern asn_TYPE_descriptor_t asn_DEF_ThreePlus; |
| 91 | asn_struct_free_f ThreePlus_free; |
| 92 | asn_struct_print_f ThreePlus_print; |
| 93 | asn_constr_check_f ThreePlus_constraint; |
| 94 | ber_type_decoder_f ThreePlus_decode_ber; |
| 95 | der_type_encoder_f ThreePlus_encode_der; |
| 96 | xer_type_decoder_f ThreePlus_decode_xer; |
| 97 | xer_type_encoder_f ThreePlus_encode_xer; |
| 98 | |
| 99 | /*** <<< CODE [ThreePlus] >>> ***/ |
| 100 | |
| 101 | int |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 102 | ThreePlus_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 103 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 104 | const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr; |
| 105 | long value; |
| 106 | |
| 107 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 108 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 109 | "%s: value not given (%s:%d)", |
| 110 | td->name, __FILE__, __LINE__); |
| 111 | return -1; |
| 112 | } |
| 113 | |
| 114 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 115 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 116 | "%s: value too large (%s:%d)", |
| 117 | td->name, __FILE__, __LINE__); |
| 118 | return -1; |
| 119 | } |
| 120 | |
| 121 | if((value >= 3)) { |
| 122 | /* Constraint check succeeded */ |
| 123 | return 0; |
| 124 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 125 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 126 | "%s: constraint failed (%s:%d)", |
| 127 | td->name, __FILE__, __LINE__); |
| 128 | return -1; |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /* |
| 133 | * This type is implemented using MinMax_16P0, |
| 134 | * so here we adjust the DEF accordingly. |
| 135 | */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 136 | |
| 137 | /*** <<< STAT-DEFS [ThreePlus] >>> ***/ |
| 138 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 139 | static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 140 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 141 | }; |
| 142 | asn_TYPE_descriptor_t asn_DEF_ThreePlus = { |
| 143 | "ThreePlus", |
| 144 | "ThreePlus", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 145 | &asn_OP_INTEGER, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 146 | asn_DEF_ThreePlus_tags_1, |
| 147 | sizeof(asn_DEF_ThreePlus_tags_1) |
| 148 | /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ |
| 149 | asn_DEF_ThreePlus_tags_1, /* Same as above */ |
| 150 | sizeof(asn_DEF_ThreePlus_tags_1) |
| 151 | /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 152 | { 0, 0, ThreePlus_constraint }, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 153 | 0, 0, /* No members */ |
| 154 | 0 /* No specifics */ |
| 155 | }; |
| 156 | |