remark release date
[Net-Radio-Location-SUPL-Test.git] / asn1 / SETId.c
blob623a53bee61aa265da2d2eb7f52dae37e6b641b0
1 /*
2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "ULP-Components"
4 * found in "../asn1src/ULP-Components.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
6 */
8 #include "SETId.h"
10 static int check_permitted_alphabet_6(const void *sptr) {
11 /* The underlying type is IA5String */
12 const IA5String_t *st = (const IA5String_t *)sptr;
13 const uint8_t *ch = st->buf;
14 const uint8_t *end = ch + st->size;
16 for(; ch < end; ch++) {
17 uint8_t cv = *ch;
18 if(!(cv <= 127)) return -1;
20 return 0;
23 static int
24 memb_msisdn_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
25 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
26 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
27 size_t size;
29 if(!sptr) {
30 _ASN_CTFAIL(app_key, td, sptr,
31 "%s: value not given (%s:%d)",
32 td->name, __FILE__, __LINE__);
33 return -1;
36 size = st->size;
38 if((size == 8)) {
39 /* Constraint check succeeded */
40 return 0;
41 } else {
42 _ASN_CTFAIL(app_key, td, sptr,
43 "%s: constraint failed (%s:%d)",
44 td->name, __FILE__, __LINE__);
45 return -1;
49 static int
50 memb_mdn_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
51 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
52 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
53 size_t size;
55 if(!sptr) {
56 _ASN_CTFAIL(app_key, td, sptr,
57 "%s: value not given (%s:%d)",
58 td->name, __FILE__, __LINE__);
59 return -1;
62 size = st->size;
64 if((size == 8)) {
65 /* Constraint check succeeded */
66 return 0;
67 } else {
68 _ASN_CTFAIL(app_key, td, sptr,
69 "%s: constraint failed (%s:%d)",
70 td->name, __FILE__, __LINE__);
71 return -1;
75 static int
76 memb_min_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
77 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
78 const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
79 size_t size;
81 if(!sptr) {
82 _ASN_CTFAIL(app_key, td, sptr,
83 "%s: value not given (%s:%d)",
84 td->name, __FILE__, __LINE__);
85 return -1;
88 if(st->size > 0) {
89 /* Size in bits */
90 size = 8 * st->size - (st->bits_unused & 0x07);
91 } else {
92 size = 0;
95 if((size == 34)) {
96 /* Constraint check succeeded */
97 return 0;
98 } else {
99 _ASN_CTFAIL(app_key, td, sptr,
100 "%s: constraint failed (%s:%d)",
101 td->name, __FILE__, __LINE__);
102 return -1;
106 static int
107 memb_imsi_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
108 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
109 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
110 size_t size;
112 if(!sptr) {
113 _ASN_CTFAIL(app_key, td, sptr,
114 "%s: value not given (%s:%d)",
115 td->name, __FILE__, __LINE__);
116 return -1;
119 size = st->size;
121 if((size == 8)) {
122 /* Constraint check succeeded */
123 return 0;
124 } else {
125 _ASN_CTFAIL(app_key, td, sptr,
126 "%s: constraint failed (%s:%d)",
127 td->name, __FILE__, __LINE__);
128 return -1;
132 static int
133 memb_nai_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
134 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
135 const IA5String_t *st = (const IA5String_t *)sptr;
136 size_t size;
138 if(!sptr) {
139 _ASN_CTFAIL(app_key, td, sptr,
140 "%s: value not given (%s:%d)",
141 td->name, __FILE__, __LINE__);
142 return -1;
145 size = st->size;
147 if((size >= 1 && size <= 1000)
148 && !check_permitted_alphabet_6(st)) {
149 /* Constraint check succeeded */
150 return 0;
151 } else {
152 _ASN_CTFAIL(app_key, td, sptr,
153 "%s: constraint failed (%s:%d)",
154 td->name, __FILE__, __LINE__);
155 return -1;
159 static asn_per_constraints_t asn_PER_memb_msisdn_constr_2 = {
160 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
161 { APC_CONSTRAINED, 0, 0, 8, 8 } /* (SIZE(8..8)) */,
162 0, 0 /* No PER value map */
164 static asn_per_constraints_t asn_PER_memb_mdn_constr_3 = {
165 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
166 { APC_CONSTRAINED, 0, 0, 8, 8 } /* (SIZE(8..8)) */,
167 0, 0 /* No PER value map */
169 static asn_per_constraints_t asn_PER_memb_min_constr_4 = {
170 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
171 { APC_CONSTRAINED, 0, 0, 34, 34 } /* (SIZE(34..34)) */,
172 0, 0 /* No PER value map */
174 static asn_per_constraints_t asn_PER_memb_imsi_constr_5 = {
175 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
176 { APC_CONSTRAINED, 0, 0, 8, 8 } /* (SIZE(8..8)) */,
177 0, 0 /* No PER value map */
179 static asn_per_constraints_t asn_PER_memb_nai_constr_6 = {
180 { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
181 { APC_CONSTRAINED, 10, 10, 1, 1000 } /* (SIZE(1..1000)) */,
182 0, 0 /* No PER character map necessary */
184 static asn_per_constraints_t asn_PER_type_SETId_constr_1 = {
185 { APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 5 } /* (0..5,...) */,
186 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
187 0, 0 /* No PER value map */
189 static asn_TYPE_member_t asn_MBR_SETId_1[] = {
190 { ATF_NOFLAGS, 0, offsetof(struct SETId, choice.msisdn),
191 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
192 -1, /* IMPLICIT tag at current level */
193 &asn_DEF_OCTET_STRING,
194 memb_msisdn_constraint_1,
195 &asn_PER_memb_msisdn_constr_2,
197 "msisdn"
199 { ATF_NOFLAGS, 0, offsetof(struct SETId, choice.mdn),
200 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
201 -1, /* IMPLICIT tag at current level */
202 &asn_DEF_OCTET_STRING,
203 memb_mdn_constraint_1,
204 &asn_PER_memb_mdn_constr_3,
206 "mdn"
208 { ATF_NOFLAGS, 0, offsetof(struct SETId, choice.min),
209 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
210 -1, /* IMPLICIT tag at current level */
211 &asn_DEF_BIT_STRING,
212 memb_min_constraint_1,
213 &asn_PER_memb_min_constr_4,
215 "min"
217 { ATF_NOFLAGS, 0, offsetof(struct SETId, choice.imsi),
218 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
219 -1, /* IMPLICIT tag at current level */
220 &asn_DEF_OCTET_STRING,
221 memb_imsi_constraint_1,
222 &asn_PER_memb_imsi_constr_5,
224 "imsi"
226 { ATF_NOFLAGS, 0, offsetof(struct SETId, choice.nai),
227 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
228 -1, /* IMPLICIT tag at current level */
229 &asn_DEF_IA5String,
230 memb_nai_constraint_1,
231 &asn_PER_memb_nai_constr_6,
233 "nai"
235 { ATF_NOFLAGS, 0, offsetof(struct SETId, choice.iPAddress),
236 (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
237 +1, /* EXPLICIT tag at current level */
238 &asn_DEF_IPAddress,
239 0, /* Defer constraints checking to the member type */
240 0, /* No PER visible constraints */
242 "iPAddress"
245 static asn_TYPE_tag2member_t asn_MAP_SETId_tag2el_1[] = {
246 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* msisdn at 23 */
247 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* mdn at 24 */
248 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* min at 25 */
249 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* imsi at 26 */
250 { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* nai at 27 */
251 { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* iPAddress at 28 */
253 static asn_CHOICE_specifics_t asn_SPC_SETId_specs_1 = {
254 sizeof(struct SETId),
255 offsetof(struct SETId, _asn_ctx),
256 offsetof(struct SETId, present),
257 sizeof(((struct SETId *)0)->present),
258 asn_MAP_SETId_tag2el_1,
259 6, /* Count of tags in the map */
261 6 /* Extensions start */
263 asn_TYPE_descriptor_t asn_DEF_SETId = {
264 "SETId",
265 "SETId",
266 CHOICE_free,
267 CHOICE_print,
268 CHOICE_constraint,
269 CHOICE_decode_ber,
270 CHOICE_encode_der,
271 CHOICE_decode_xer,
272 CHOICE_encode_xer,
273 CHOICE_decode_uper,
274 CHOICE_encode_uper,
275 CHOICE_outmost_tag,
276 0, /* No effective tags (pointer) */
277 0, /* No effective tags (count) */
278 0, /* No tags (pointer) */
279 0, /* No tags (count) */
280 &asn_PER_type_SETId_constr_1,
281 asn_MBR_SETId_1,
282 6, /* Elements count */
283 &asn_SPC_SETId_specs_1 /* Additional specs */