blob: 3859933c1bd960f2cdabd46369f12797aec49fdd [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
Lev Walkin20696a42017-10-17 21:27:33 -070024MinMax_16P0_constraint(const 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 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 Walkin0bfea562017-09-29 23:16:48 -070074 { 0, 0, MinMax_16P0_constraint },
Lev Walkin171487e2006-03-21 07:25:18 +000075 0, 0, /* No members */
76 0 /* No specifics */
77};
78
79
80/*** <<< INCLUDES [ThreePlus] >>> ***/
81
Lev Walkin22b5ed42006-09-13 02:51:20 +000082#include "MinMax.h"
Lev Walkin171487e2006-03-21 07:25:18 +000083
84/*** <<< TYPE-DECLS [ThreePlus] >>> ***/
85
86typedef MinMax_16P0_t ThreePlus_t;
87
88/*** <<< FUNC-DECLS [ThreePlus] >>> ***/
89
90extern asn_TYPE_descriptor_t asn_DEF_ThreePlus;
91asn_struct_free_f ThreePlus_free;
92asn_struct_print_f ThreePlus_print;
93asn_constr_check_f ThreePlus_constraint;
94ber_type_decoder_f ThreePlus_decode_ber;
95der_type_encoder_f ThreePlus_encode_der;
96xer_type_decoder_f ThreePlus_decode_xer;
97xer_type_encoder_f ThreePlus_encode_xer;
98
99/*** <<< CODE [ThreePlus] >>> ***/
100
101int
Lev Walkin20696a42017-10-17 21:27:33 -0700102ThreePlus_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +0000103 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin171487e2006-03-21 07:25:18 +0000104 const MinMax_16P0_t *st = (const MinMax_16P0_t *)sptr;
105 long value;
106
107 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700108 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000109 "%s: value not given (%s:%d)",
110 td->name, __FILE__, __LINE__);
111 return -1;
112 }
113
114 if(asn_INTEGER2long(st, &value)) {
Lev Walkin7c1dc052016-03-14 03:08:15 -0700115 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000116 "%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 Walkin7c1dc052016-03-14 03:08:15 -0700125 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin171487e2006-03-21 07:25:18 +0000126 "%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 Walkin171487e2006-03-21 07:25:18 +0000136
137/*** <<< STAT-DEFS [ThreePlus] >>> ***/
138
Lev Walkina7591b52014-10-12 18:37:35 -0700139static const ber_tlv_tag_t asn_DEF_ThreePlus_tags_1[] = {
Lev Walkin171487e2006-03-21 07:25:18 +0000140 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
141};
142asn_TYPE_descriptor_t asn_DEF_ThreePlus = {
143 "ThreePlus",
144 "ThreePlus",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800145 &asn_OP_INTEGER,
Lev Walkin171487e2006-03-21 07:25:18 +0000146 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 Walkin0bfea562017-09-29 23:16:48 -0700152 { 0, 0, ThreePlus_constraint },
Lev Walkin171487e2006-03-21 07:25:18 +0000153 0, 0, /* No members */
154 0 /* No specifics */
155};
156