blob: c20a0c6eed915975aa6cdf593a1a5068604aed90 [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, Chiu1f87ac02017-08-20 01:25:45 +080067 &asn_OP_INTEGER,
Lev Walkin171487e2006-03-21 07:25:18 +000068 MinMax_16P0_constraint,
Lev Walkin171487e2006-03-21 07:25:18 +000069 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 Walkinb33425f2017-07-14 14:59:52 +040075 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +000076 0, /* No PER visible constraints */
77 0, 0, /* No members */
78 0 /* No specifics */
79};
80
81
82/*** <<< INCLUDES [ThreePlus] >>> ***/
83
Lev Walkin22b5ed42006-09-13 02:51:20 +000084#include "MinMax.h"
Lev Walkin171487e2006-03-21 07:25:18 +000085
86/*** <<< TYPE-DECLS [ThreePlus] >>> ***/
87
88typedef MinMax_16P0_t ThreePlus_t;
89
90/*** <<< FUNC-DECLS [ThreePlus] >>> ***/
91
92extern asn_TYPE_descriptor_t asn_DEF_ThreePlus;
93asn_struct_free_f ThreePlus_free;
94asn_struct_print_f ThreePlus_print;
95asn_constr_check_f ThreePlus_constraint;
96ber_type_decoder_f ThreePlus_decode_ber;
97der_type_encoder_f ThreePlus_encode_der;
98xer_type_decoder_f ThreePlus_decode_xer;
99xer_type_encoder_f ThreePlus_encode_xer;
100
101/*** <<< CODE [ThreePlus] >>> ***/
102
103int
104ThreePlus_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000105 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000106 const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr;
107 long value;
108
109 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700110 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000111 "%s: value not given (%s:%d)",
112 td->name, __FILE__, __LINE__);
113 return -1;
114 }
115
116 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700117 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000118 "%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 Walkin7c1dc052016-03-14 03:08:15 -0700127 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000128 "%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 Walkin171487e2006-03-21 07:25:18 +0000138
139/*** <<< STAT-DEFS [ThreePlus] >>> ***/
140
Lev Walkina7591b52014-10-12 18:37:35 -0700141static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000142 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
143};
144asn_TYPE_descriptor_t asn_DEF_ThreePlus = {
145 "ThreePlus",
146 "ThreePlus",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800147 &asn_OP_INTEGER,
Lev Walkin171487e2006-03-21 07:25:18 +0000148 ThreePlus_constraint,
Lev Walkin171487e2006-03-21 07:25:18 +0000149 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 Walkinb33425f2017-07-14 14:59:52 +0400155 0, /* No OER visible constraints */
Lev Walkin171487e2006-03-21 07:25:18 +0000156 0, /* No PER visible constraints */
157 0, 0, /* No members */
158 0 /* No specifics */
159};
160