blob: 7be99add0501898f34b3ae5fa40784fc80349b8e [file] [log] [blame]
Lev Walkin171487e2006-03-21 07:25:18 +00001
2/*** <<< INCLUDES [MinMax] >>> ***/
3
4#include <INTEGER.h>
5
6/*** <<< TYPE-DECLS [MinMax] >>> ***/
7
8typedef INTEGER_t MinMax_16P0_t;
9
10/*** <<< FUNC-DECLS [MinMax] >>> ***/
11
12extern asn_TYPE_descriptor_t asn_DEF_MinMax_16P0;
13asn_struct_free_f MinMax_16P0_free;
14asn_struct_print_f MinMax_16P0_print;
15asn_constr_check_f MinMax_16P0_constraint;
16ber_type_decoder_f MinMax_16P0_decode_ber;
17der_type_encoder_f MinMax_16P0_encode_der;
18xer_type_decoder_f MinMax_16P0_decode_xer;
19xer_type_encoder_f MinMax_16P0_encode_xer;
20
21/*** <<< CODE [MinMax] >>> ***/
22
23int
24MinMax_16P0_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000025 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +000026 const INTEGER_t *st = (const INTEGER_t *)sptr;
27 long value;
28
29 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070030 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +000031 "%s: value not given (%s:%d)",
32 td->name, __FILE__, __LINE__);
33 return -1;
34 }
35
36 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070037 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +000038 "%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 Walkin7c1dc052016-03-14 03:08:15 -070047 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +000048 "%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 Walkin171487e2006-03-21 07:25:18 +000058
59/*** <<< STAT-DEFS [MinMax] >>> ***/
60
Lev Walkina7591b52014-10-12 18:37:35 -070061static const ber_tlv_tag_t asn_DEF_MinMax_16P0_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +000062 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
63};
64asn_TYPE_descriptor_t asn_DEF_MinMax_16P0 = {
65 "MinMax",
66 "MinMax",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080067 INTEGER_free,
68 INTEGER_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -070069 INTEGER_compare,
Lev Walkin171487e2006-03-21 07:25:18 +000070 MinMax_16P0_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080071 INTEGER_decode_ber,
72 INTEGER_encode_der,
73 INTEGER_decode_xer,
74 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -070075 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +040076 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +000077 0, /* Use generic outmost tag fetcher */
78 asn_DEF_MinMax_16P0_tags_1,
79 sizeof(asn_DEF_MinMax_16P0_tags_1)
80 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
81 asn_DEF_MinMax_16P0_tags_1, /* Same as above */
82 sizeof(asn_DEF_MinMax_16P0_tags_1)
83 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +040084 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +000085 0, /* No PER visible constraints */
86 0, 0, /* No members */
87 0 /* No specifics */
88};
89
90
91/*** <<< INCLUDES [ThreePlus] >>> ***/
92
Lev Walkin22b5ed42006-09-13 02:51:20 +000093#include "MinMax.h"
Lev Walkin171487e2006-03-21 07:25:18 +000094
95/*** <<< TYPE-DECLS [ThreePlus] >>> ***/
96
97typedef MinMax_16P0_t ThreePlus_t;
98
99/*** <<< FUNC-DECLS [ThreePlus] >>> ***/
100
101extern asn_TYPE_descriptor_t asn_DEF_ThreePlus;
102asn_struct_free_f ThreePlus_free;
103asn_struct_print_f ThreePlus_print;
104asn_constr_check_f ThreePlus_constraint;
105ber_type_decoder_f ThreePlus_decode_ber;
106der_type_encoder_f ThreePlus_encode_der;
107xer_type_decoder_f ThreePlus_decode_xer;
108xer_type_encoder_f ThreePlus_encode_xer;
109
110/*** <<< CODE [ThreePlus] >>> ***/
111
112int
113ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000114 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000115 const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr;
116 long value;
117
118 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700119 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000120 "%s: value not given (%s:%d)",
121 td->name, __FILE__, __LINE__);
122 return -1;
123 }
124
125 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700126 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000127 "%s: value too large (%s:%d)",
128 td->name, __FILE__, __LINE__);
129 return -1;
130 }
131
132 if((value >= 3)) {
133 /* Constraint check succeeded */
134 return 0;
135 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700136 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000137 "%s: constraint failed (%s:%d)",
138 td->name, __FILE__, __LINE__);
139 return -1;
140 }
141}
142
143/*
144 * This type is implemented using MinMax_16P0,
145 * so here we adjust the DEF accordingly.
146 */
Lev Walkin171487e2006-03-21 07:25:18 +0000147
148/*** <<< STAT-DEFS [ThreePlus] >>> ***/
149
Lev Walkina7591b52014-10-12 18:37:35 -0700150static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000151 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
152};
153asn_TYPE_descriptor_t asn_DEF_ThreePlus = {
154 "ThreePlus",
155 "ThreePlus",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800156 INTEGER_free,
157 INTEGER_print,
Lev Walkincd2f48e2017-08-10 02:14:59 -0700158 INTEGER_compare,
Lev Walkin171487e2006-03-21 07:25:18 +0000159 ThreePlus_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800160 INTEGER_decode_ber,
161 INTEGER_encode_der,
162 INTEGER_decode_xer,
163 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700164 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400165 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000166 0, /* Use generic outmost tag fetcher */
167 asn_DEF_ThreePlus_tags_1,
168 sizeof(asn_DEF_ThreePlus_tags_1)
169 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
170 asn_DEF_ThreePlus_tags_1, /* Same as above */
171 sizeof(asn_DEF_ThreePlus_tags_1)
172 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400173 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000174 0, /* No PER visible constraints */
175 0, 0, /* No members */
176 0 /* No specifics */
177};
178