blob: 67ae9503cf93d097b4984031e0e78e72b2da1664 [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 Walkin171487e2006-03-21 07:25:18 +000069 MinMax_16P0_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080070 INTEGER_decode_ber,
71 INTEGER_encode_der,
72 INTEGER_decode_xer,
73 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -070074 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +040075 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +000076 0, /* Use generic outmost tag fetcher */
77 asn_DEF_MinMax_16P0_tags_1,
78 sizeof(asn_DEF_MinMax_16P0_tags_1)
79 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
80 asn_DEF_MinMax_16P0_tags_1, /* Same as above */
81 sizeof(asn_DEF_MinMax_16P0_tags_1)
82 /sizeof(asn_DEF_MinMax_16P0_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +040083 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +000084 0, /* No PER visible constraints */
85 0, 0, /* No members */
86 0 /* No specifics */
87};
88
89
90/*** <<< INCLUDES [ThreePlus] >>> ***/
91
Lev Walkin22b5ed42006-09-13 02:51:20 +000092#include "MinMax.h"
Lev Walkin171487e2006-03-21 07:25:18 +000093
94/*** <<< TYPE-DECLS [ThreePlus] >>> ***/
95
96typedef MinMax_16P0_t ThreePlus_t;
97
98/*** <<< FUNC-DECLS [ThreePlus] >>> ***/
99
100extern asn_TYPE_descriptor_t asn_DEF_ThreePlus;
101asn_struct_free_f ThreePlus_free;
102asn_struct_print_f ThreePlus_print;
103asn_constr_check_f ThreePlus_constraint;
104ber_type_decoder_f ThreePlus_decode_ber;
105der_type_encoder_f ThreePlus_encode_der;
106xer_type_decoder_f ThreePlus_decode_xer;
107xer_type_encoder_f ThreePlus_encode_xer;
108
109/*** <<< CODE [ThreePlus] >>> ***/
110
111int
112ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000113 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000114 const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr;
115 long value;
116
117 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700118 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000119 "%s: value not given (%s:%d)",
120 td->name, __FILE__, __LINE__);
121 return -1;
122 }
123
124 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700125 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000126 "%s: value too large (%s:%d)",
127 td->name, __FILE__, __LINE__);
128 return -1;
129 }
130
131 if((value >= 3)) {
132 /* Constraint check succeeded */
133 return 0;
134 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700135 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000136 "%s: constraint failed (%s:%d)",
137 td->name, __FILE__, __LINE__);
138 return -1;
139 }
140}
141
142/*
143 * This type is implemented using MinMax_16P0,
144 * so here we adjust the DEF accordingly.
145 */
Lev Walkin171487e2006-03-21 07:25:18 +0000146
147/*** <<< STAT-DEFS [ThreePlus] >>> ***/
148
Lev Walkina7591b52014-10-12 18:37:35 -0700149static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000150 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
151};
152asn_TYPE_descriptor_t asn_DEF_ThreePlus = {
153 "ThreePlus",
154 "ThreePlus",
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800155 INTEGER_free,
156 INTEGER_print,
Lev Walkin171487e2006-03-21 07:25:18 +0000157 ThreePlus_constraint,
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +0800158 INTEGER_decode_ber,
159 INTEGER_encode_der,
160 INTEGER_decode_xer,
161 INTEGER_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -0700162 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +0400163 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin171487e2006-03-21 07:25:18 +0000164 0, /* Use generic outmost tag fetcher */
165 asn_DEF_ThreePlus_tags_1,
166 sizeof(asn_DEF_ThreePlus_tags_1)
167 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
168 asn_DEF_ThreePlus_tags_1, /* Same as above */
169 sizeof(asn_DEF_ThreePlus_tags_1)
170 /sizeof(asn_DEF_ThreePlus_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400171 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000172 0, /* No PER visible constraints */
173 0, 0, /* No members */
174 0 /* No specifics */
175};
176