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 |
| 24 | MinMax_16P0_constraint(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 | MinMax_16P0_constraint, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 69 | asn_DEF_MinMax_16P0_tags_1, |
| 70 | sizeof(asn_DEF_MinMax_16P0_tags_1) |
| 71 | /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ |
| 72 | asn_DEF_MinMax_16P0_tags_1, /* Same as above */ |
| 73 | sizeof(asn_DEF_MinMax_16P0_tags_1) |
| 74 | /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 75 | 0, /* No OER visible constraints */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 76 | 0, /* No PER visible constraints */ |
| 77 | 0, 0, /* No members */ |
| 78 | 0 /* No specifics */ |
| 79 | }; |
| 80 | |
| 81 | |
| 82 | /*** <<< INCLUDES [ThreePlus] >>> ***/ |
| 83 | |
Lev Walkin | 22b5ed4 | 2006-09-13 02:51:20 +0000 | [diff] [blame] | 84 | #include "MinMax.h" |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 85 | |
| 86 | /*** <<< TYPE-DECLS [ThreePlus] >>> ***/ |
| 87 | |
| 88 | typedef MinMax_16P0_t ThreePlus_t; |
| 89 | |
| 90 | /*** <<< FUNC-DECLS [ThreePlus] >>> ***/ |
| 91 | |
| 92 | extern asn_TYPE_descriptor_t asn_DEF_ThreePlus; |
| 93 | asn_struct_free_f ThreePlus_free; |
| 94 | asn_struct_print_f ThreePlus_print; |
| 95 | asn_constr_check_f ThreePlus_constraint; |
| 96 | ber_type_decoder_f ThreePlus_decode_ber; |
| 97 | der_type_encoder_f ThreePlus_encode_der; |
| 98 | xer_type_decoder_f ThreePlus_decode_xer; |
| 99 | xer_type_encoder_f ThreePlus_encode_xer; |
| 100 | |
| 101 | /*** <<< CODE [ThreePlus] >>> ***/ |
| 102 | |
| 103 | int |
| 104 | ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 1eded35 | 2006-07-13 11:19:01 +0000 | [diff] [blame] | 105 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 106 | const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr; |
| 107 | long value; |
| 108 | |
| 109 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 110 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 111 | "%s: value not given (%s:%d)", |
| 112 | td->name, __FILE__, __LINE__); |
| 113 | return -1; |
| 114 | } |
| 115 | |
| 116 | if(asn_INTEGER2long(st, &value)) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 117 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 118 | "%s: value too large (%s:%d)", |
| 119 | td->name, __FILE__, __LINE__); |
| 120 | return -1; |
| 121 | } |
| 122 | |
| 123 | if((value >= 3)) { |
| 124 | /* Constraint check succeeded */ |
| 125 | return 0; |
| 126 | } else { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 127 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 128 | "%s: constraint failed (%s:%d)", |
| 129 | td->name, __FILE__, __LINE__); |
| 130 | return -1; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | /* |
| 135 | * This type is implemented using MinMax_16P0, |
| 136 | * so here we adjust the DEF accordingly. |
| 137 | */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 138 | |
| 139 | /*** <<< STAT-DEFS [ThreePlus] >>> ***/ |
| 140 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 141 | static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = { |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 142 | (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) |
| 143 | }; |
| 144 | asn_TYPE_descriptor_t asn_DEF_ThreePlus = { |
| 145 | "ThreePlus", |
| 146 | "ThreePlus", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 147 | &asn_OP_INTEGER, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 148 | ThreePlus_constraint, |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 149 | asn_DEF_ThreePlus_tags_1, |
| 150 | sizeof(asn_DEF_ThreePlus_tags_1) |
| 151 | /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ |
| 152 | asn_DEF_ThreePlus_tags_1, /* Same as above */ |
| 153 | sizeof(asn_DEF_ThreePlus_tags_1) |
| 154 | /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 155 | 0, /* No OER visible constraints */ |
Lev Walkin | 171487e | 2006-03-21 07:25:18 +0000 | [diff] [blame] | 156 | 0, /* No PER visible constraints */ |
| 157 | 0, 0, /* No members */ |
| 158 | 0 /* No specifics */ |
| 159 | }; |
| 160 | |