Debian Codegraph @

lib/s1ap/asn1c/constr_SET_OF.c

raw symbols SCIP
1 /*
2 * Copyright (c) 2003-2017 Lev Walkin <[email protected]>.
3 * All rights reserved.
4 * Redistribution and modifications are permitted subject to BSD license.
5 */
6 #include <asn_internal.h>cxx . . $ `<file>/lib/s1ap/asn1c/asn_internal.h`/
7 #include <constr_SET_OF.h>cxx . . $ `<file>/lib/s1ap/asn1c/constr_SET_OF.h`/
8 #include <asn_SET_OF.h>cxx . . $ `<file>/lib/s1ap/asn1c/asn_SET_OF.h`/
9
10 /*
11 * Number of bytes left for this structure.
12 * (ctx->left) indicates the number of bytes _transferred_ for the structure.
13 * (size) contains the number of bytes in the buffer passed.
14 */
15 #define LEFTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:15:9`! ((size<(size_t)ctx->left)?size:(size_t)ctx->left)
16
17 /*
18 * If the subprocessor function returns with an indication that it wants
19 * more data, it may well be a fatal decoding problem, because the
20 * size is constrained by the <TLV>'s L, even if the buffer size allows
21 * reading more data.
22 * For example, consider the buffer containing the following TLVs:
23 * <T:5><L:1><V> <T:6>...
24 * The TLV length clearly indicates that one byte is expected in V, but
25 * if the V processor returns with "want more data" even if the buffer
26 * contains way more data than the V processor have seen.
27 */
28 #define SIZE_VIOLATIONcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:28:9`! (ctx->left >= 0 && (size_t)ctx->left <= size)
29
30 /*
31 * This macro "eats" the part of the buffer which is definitely "consumed",
32 * i.e. was correctly converted into local representation or rightfully skipped.
33 */
34 #undef ADVANCE
35 #define ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:35:9`!(num_bytes) do { \
36 size_t num = num_bytes; \
37 ptr = ((const char *)ptr) + num;\
38 size -= num; \
39 if(ctx->left >= 0) \
40 ctx->left -= num; \
41 consumed_myself += num; \
42 } while(0)
43
44 /*
45 * Switch to the next phase of parsing.
46 */
47 #undef NEXT_PHASE
48 #undef PHASE_OUT
49 #define NEXT_PHASEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:49:9`!(ctx) do { \
50 ctx->phase++; \
51 ctx->step = 0; \
52 } while(0)
53 #define PHASE_OUTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:53:9`!(ctx) do { ctx->phase = 10; } while(0)
54
55 /*
56 * Return a standardized complex structure.
57 */
58 #undef RETURN
59 #define RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(_code) do { \
60 rval.code = _code; \
61 rval.consumed = consumed_myself;\
62 return rval; \
63 } while(0)
64
65 /*
66 * The decoder of the SET OF type.
67 */
68 asn_dec_rval_tcxx . . $ asn_dec_rval_t#
69 SET_OF_decode_bercxx . . $ SET_OF_decode_ber(96f9c71a4eda4f59).(const asn_codec_ctx_tcxx . . $ asn_codec_ctx_t# *opt_codec_ctx,
70 const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, void **struct_ptr,
71 const void *ptr, size_t size, int tag_mode) {
72 /*
73 * Bring closer parts of structure description.
74 */
75 const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *specs = (const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *)td->specificscxx . . $ asn_TYPE_descriptor_s#specifics.;
76 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.; /* Single one */
77
78 /*
79 * Parts of the structure being constructed.
80 */
81 void *st = *struct_ptr; /* Target structure. */
82 asn_struct_ctx_tcxx . . $ asn_struct_ctx_t# *ctx; /* Decoder context */
83
84 ber_tlv_tag_tcxx . . $ ber_tlv_tag_t# tlv_tag; /* T from TLV */
85 asn_dec_rval_tcxx . . $ asn_dec_rval_t# rval; /* Return code from subparsers */
86
87 ssize_tcxx . . $ ssize_t# consumed_myself = 0; /* Consumed bytes from ptr */
88
89 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Decoding %s as SET OF", td->name);
90
91 /*
92 * Create the target structure if it is not present already.
93 */
94 if(st == 0) {
95 st = *struct_ptr = CALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:33:9`!(1, specs->struct_size);
96 if(st == 0) {
97 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
98 }
99 }
100
101 /*
102 * Restore parsing context.
103 */
104 ctx = (asn_struct_ctx_tcxx . . $ asn_struct_ctx_t# *)((char *)st + specs->ctx_offsetcxx . . $ asn_SET_OF_specifics_s#ctx_offset.);
105
106 /*
107 * Start to parse where left previously
108 */
109 switch(ctx->phasecxx . . $ asn_struct_ctx_s#phase.) {
110 case 0:
111 /*
112 * PHASE 0.
113 * Check that the set of tags associated with given structure
114 * perfectly fits our expectations.
115 */
116
117 rval = ber_check_tagscxx . . $ ber_check_tags(44ee3a05e75e37f5).(opt_codec_ctx, td, ctx, ptr, size,
118 tag_mode, 1, &ctx->leftcxx . . $ asn_struct_ctx_s#left., 0);
119 if(rval.codecxx . . $ asn_dec_rval_s#code. != RC_OKcxx . . $ RC_OK.) {
120 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("%s tagging check failed: %d",
121 td->name, rval.code);
122 return rval;
123 }
124
125 if(ctx->leftcxx . . $ asn_struct_ctx_s#left. >= 0)
126 ctx->leftcxx . . $ asn_struct_ctx_s#left. += rval.consumedcxx . . $ asn_dec_rval_s#consumed.; /* ?Substracted below! */
127 ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:35:9`!(rval.consumed);
128
129 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Structure consumes %ld bytes, "
130 "buffer %ld", (long)ctx->left, (long)size);
131
132 NEXT_PHASEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:49:9`!(ctx);
133 /* Fall through */
134 case 1:
135 /*
136 * PHASE 1.
137 * From the place where we've left it previously,
138 * try to decode the next item.
139 */
140 for(;; ctx->stepcxx . . $ asn_struct_ctx_s#step. = 0) {
141 ssize_tcxx . . $ ssize_t# tag_len; /* Length of TLV's T */
142
143 if(ctx->stepcxx . . $ asn_struct_ctx_s#step. & 1)
144 goto microphase2;
145
146 /*
147 * MICROPHASE 1: Synchronize decoding.
148 */
149
150 if(ctx->leftcxx . . $ asn_struct_ctx_s#left. == 0) {
151 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("End of SET OF %s", td->name);
152 /*
153 * No more things to decode.
154 * Exit out of here.
155 */
156 PHASE_OUTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:53:9`!(ctx);
157 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_OK);
158 }
159
160 /*
161 * Fetch the T from TLV.
162 */
163 tag_len = ber_fetch_tagcxx . . $ ber_fetch_tag(356b43e416f504fd).(ptr, LEFTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:15:9`!, &tlv_tag);
164 switch(tag_len) {
165 case 0: if(!SIZE_VIOLATIONcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:28:9`!) RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_WMORE);
166 /* Fall through */
167 case -1: RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
168 }
169
170 if(ctx->leftcxx . . $ asn_struct_ctx_s#left. < 0 && ((const uint8_tcxx . . $ uint8_t# *)ptr)[0] == 0) {
171 if(LEFTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:15:9`! < 2) {
172 if(SIZE_VIOLATIONcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:28:9`!)
173 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
174 else
175 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_WMORE);
176 } else if(((const uint8_tcxx . . $ uint8_t# *)ptr)[1] == 0) {
177 /*
178 * Found the terminator of the
179 * indefinite length structure.
180 */
181 break;
182 }
183 }
184
185 /* Outmost tag may be unknown and cannot be fetched/compared */
186 if(elm->tagcxx . . $ asn_TYPE_member_s#tag. != (ber_tlv_tag_tcxx . . $ ber_tlv_tag_t#)-1) {
187 if(BER_TAGS_EQUALcxx . . $ `lib/s1ap/asn1c/ber_tlv_tag.h:27:9`!(tlv_tag, elm->tag)) {
188 /*
189 * The new list member of expected type has arrived.
190 */
191 } else {
192 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Unexpected tag %s fixed SET OF %s",
193 ber_tlv_tag_string(tlv_tag), td->name);
194 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("%s SET OF has tag %s",
195 td->name, ber_tlv_tag_string(elm->tag));
196 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
197 }
198 }
199
200 /*
201 * MICROPHASE 2: Invoke the member-specific decoder.
202 */
203 ctx->stepcxx . . $ asn_struct_ctx_s#step. |= 1; /* Confirm entering next microphase */
204 microphase2:
205
206 /*
207 * Invoke the member fetch routine according to member's type
208 */
209 rval = elm->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->ber_decodercxx . . $ asn_TYPE_operation_s#ber_decoder.(opt_codec_ctx,
210 elm->typecxx . . $ asn_TYPE_member_s#type., &ctx->ptrcxx . . $ asn_struct_ctx_s#ptr., ptr, LEFTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:15:9`!, 0);
211 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("In %s SET OF %s code %d consumed %d",
212 td->name, elm->type->name,
213 rval.code, (int)rval.consumed);
214 switch(rval.codecxx . . $ asn_dec_rval_s#code.) {
215 case RC_OKcxx . . $ RC_OK.:
216 {
217 asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list = _A_SET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:65:9`!(st);
218 if(ASN_SET_ADDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:30:9`!(list, ctx->ptr) != 0)
219 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
220 else
221 ctx->ptrcxx . . $ asn_struct_ctx_s#ptr. = 0;
222 }
223 break;
224 case RC_WMOREcxx . . $ RC_WMORE.: /* More data expected */
225 if(!SIZE_VIOLATIONcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:28:9`!) {
226 ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:35:9`!(rval.consumed);
227 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_WMORE);
228 }
229 /* Fall through */
230 case RC_FAILcxx . . $ RC_FAIL.: /* Fatal error */
231 ASN_STRUCT_FREEcxx . . $ `lib/s1ap/asn1c/constr_TYPE.h:72:9`!(*elm->type, ctx->ptr);
232 ctx->ptrcxx . . $ asn_struct_ctx_s#ptr. = 0;
233 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
234 } /* switch(rval) */
235
236 ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:35:9`!(rval.consumed);
237 } /* for(all list members) */
238
239 NEXT_PHASEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:49:9`!(ctx);
240 case 2:
241 /*
242 * Read in all "end of content" TLVs.
243 */
244 while(ctx->leftcxx . . $ asn_struct_ctx_s#left. < 0) {
245 if(LEFTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:15:9`! < 2) {
246 if(LEFTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:15:9`! > 0 && ((const char *)ptr)[0] != 0) {
247 /* Unexpected tag */
248 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
249 } else {
250 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_WMORE);
251 }
252 }
253 if(((const char *)ptr)[0] == 0
254 && ((const char *)ptr)[1] == 0) {
255 ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:35:9`!(2);
256 ctx->leftcxx . . $ asn_struct_ctx_s#left.++;
257 } else {
258 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
259 }
260 }
261
262 PHASE_OUTcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:53:9`!(ctx);
263 }
264
265 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_OK);
266 }
267
268 /*
269 * Internally visible buffer holding a single encoded element.
270 */
271 struct _el_buffercxx . . $ _el_buffer# {
272 uint8_tcxx . . $ uint8_t# *bufcxx . . $ _el_buffer#buf.;
273 size_t lengthcxx . . $ _el_buffer#length.;
274 size_t allocated_sizecxx . . $ _el_buffer#allocated_size.;
275 unsigned bits_unusedcxx . . $ _el_buffer#bits_unused.;
276 };
277 /* Append bytes to the above structure */
278 static int _el_addbytescxx . . $ _el_addbytes(d5add74c253e2b79).(const void *buffer, size_t size, void *el_buf_ptr) {
279 struct _el_buffercxx . . $ _el_buffer# *el_buf = (struct _el_buffercxx . . $ _el_buffer# *)el_buf_ptr;
280
281 if(el_buf->lengthcxx . . $ _el_buffer#length. + size > el_buf->allocated_sizecxx . . $ _el_buffer#allocated_size.) {
282 size_t new_size = el_buf->allocated_sizecxx . . $ _el_buffer#allocated_size. ? el_buf->allocated_sizecxx . . $ _el_buffer#allocated_size. : 8;
283 void *p;
284
285 do {
286 new_size <<= 2;
287 } while(el_buf->lengthcxx . . $ _el_buffer#length. + size > new_size);
288
289 p = REALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:35:9`!(el_buf->buf, new_size);
290 if(p) {
291 el_buf->bufcxx . . $ _el_buffer#buf. = p;
292 el_buf->allocated_sizecxx . . $ _el_buffer#allocated_size. = new_size;
293 } else {
294 return -1;
295 }
296 }
297
298 memcpycxx . . $ memcpy(cc817cb175f282d).(el_buf->bufcxx . . $ _el_buffer#buf. + el_buf->lengthcxx . . $ _el_buffer#length., buffer, size);
299
300 el_buf->lengthcxx . . $ _el_buffer#length. += size;
301 return 0;
302 }
303
304 static void assert_unused_bitscxx . . $ assert_unused_bits(f0a45e817ddfd9c1).(const struct _el_buffercxx . . $ _el_buffer#* p) {
305 if(p->lengthcxx . . $ _el_buffer#length.) {
306 assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!((p->buf[p->length-1] & ~(0xff << p->bits_unused)) == 0);
307 } else {
308 assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(p->bits_unused == 0);
309 }
310 }
311
312 static int _el_buf_cmpcxx . . $ _el_buf_cmp(9148c8c3ff42c9d8).(const void *ap, const void *bp) {
313 const struct _el_buffercxx . . $ _el_buffer# *a = (const struct _el_buffercxx . . $ _el_buffer# *)ap;
314 const struct _el_buffercxx . . $ _el_buffer# *b = (const struct _el_buffercxx . . $ _el_buffer# *)bp;
315 size_t common_len;
316 int ret = 0;
317
318 if(a->lengthcxx . . $ _el_buffer#length. < b->lengthcxx . . $ _el_buffer#length.)
319 common_len = a->lengthcxx . . $ _el_buffer#length.;
320 else
321 common_len = b->lengthcxx . . $ _el_buffer#length.;
322
323 if (a->bufcxx . . $ _el_buffer#buf. && b->bufcxx . . $ _el_buffer#buf.) {
324 ret = memcmpcxx . . $ memcmp(36f949851efa3055).(a->bufcxx . . $ _el_buffer#buf., b->bufcxx . . $ _el_buffer#buf., common_len);
325 }
326 if(ret == 0) {
327 if(a->lengthcxx . . $ _el_buffer#length. < b->lengthcxx . . $ _el_buffer#length.)
328 ret = -1;
329 else if(a->lengthcxx . . $ _el_buffer#length. > b->lengthcxx . . $ _el_buffer#length.)
330 ret = 1;
331 /* Ignore unused bits. */
332 assert_unused_bitscxx . . $ assert_unused_bits(f0a45e817ddfd9c1).(a);
333 assert_unused_bitscxx . . $ assert_unused_bits(f0a45e817ddfd9c1).(b);
334 }
335
336 return ret;
337 }
338
339 static void
340 SET_OF__encode_sorted_freecxx . . $ SET_OF__encode_sorted_free(920be1e3a590e9a7).(struct _el_buffercxx . . $ _el_buffer# *el_buf, size_t count) {
341 size_t i;
342
343 for(i = 0; i < count; i++) {
344 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(el_buf[i].buf);
345 }
346
347 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(el_buf);
348 }
349
350 enum SET_OF__encode_methodcxx . . $ SET_OF__encode_method# {
351 SOES_DERcxx . . $ SOES_DER., /* Distinguished Encoding Rules */
352 SOES_CUPERcxx . . $ SOES_CUPER. /* Canonical Unaligned Packed Encoding Rules */
353 };
354
355 static struct _el_buffercxx . . $ _el_buffer# *
356 SET_OF__encode_sortedcxx . . $ SET_OF__encode_sorted(ea123826a6eb077c).(const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm,
357 const asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list,
358 enum SET_OF__encode_methodcxx . . $ SET_OF__encode_method# method) {
359 static struct _el_buffercxx . . $ _el_buffer# *encoded_els;
360 int edx;
361
362 encoded_els =
363 (struct _el_buffercxx . . $ _el_buffer# *)CALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:33:9`!(list->count, sizeof(encoded_els[0]));
364 if(encoded_els == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
365 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
366 }
367
368 /*
369 * Encode all members.
370 */
371 for(edx = 0; edx < list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; edx++) {
372 const void *memb_ptr = list->arraycxx . . $ $anonymous_type_9dabb0f578c92d03_0#array.[edx];
373 struct _el_buffercxx . . $ _el_buffer# *encoding_el = &encoded_els[edx];
374 asn_enc_rval_tcxx . . $ asn_enc_rval_t# erval;
375
376 if(!memb_ptr) break;
377
378 /*
379 * Encode the member into the prepared space.
380 */
381 switch(method) {
382 case SOES_DERcxx . . $ SOES_DER.:
383 erval = elm->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->der_encodercxx . . $ asn_TYPE_operation_s#der_encoder.(elm->typecxx . . $ asn_TYPE_member_s#type., memb_ptr, 0, elm->tagcxx . . $ asn_TYPE_member_s#tag.,
384 _el_addbytescxx . . $ _el_addbytes(d5add74c253e2b79)., encoding_el);
385 break;
386 case SOES_CUPERcxx . . $ SOES_CUPER.:
387 erval = uper_encodecxx . . $ uper_encode(75b307259800e446).(elm->typecxx . . $ asn_TYPE_member_s#type.,
388 elm->encoding_constraintscxx . . $ asn_TYPE_member_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.,
389 memb_ptr, _el_addbytescxx . . $ _el_addbytes(d5add74c253e2b79)., encoding_el);
390 if(erval.encodedcxx . . $ asn_enc_rval_s#encoded. != -1) {
391 size_t extra_bits = erval.encodedcxx . . $ asn_enc_rval_s#encoded. % 8;
392 assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(encoding_el->length == (size_t)(erval.encoded + 7) / 8);
393 encoding_el->bits_unusedcxx . . $ _el_buffer#bits_unused. = (8 - extra_bits) & 0x7;
394 }
395 break;
396 default:
397 assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(!"Unreachable");
398 break;
399 }
400 if(erval.encodedcxx . . $ asn_enc_rval_s#encoded. < 0) break;
401 }
402
403 if(edx == list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.) {
404 /*
405 * Sort the encoded elements according to their encoding.
406 */
407 qsortcxx . . $ qsort(ebb60b13a65e77d7).(encoded_els, list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count., sizeof(encoded_els[0]), _el_buf_cmpcxx . . $ _el_buf_cmp(9148c8c3ff42c9d8).);
408
409 return encoded_els;
410 } else {
411 SET_OF__encode_sorted_freecxx . . $ SET_OF__encode_sorted_free(920be1e3a590e9a7).(encoded_els, edx);
412 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
413 }
414 }
415
416
417 /*
418 * The DER encoder of the SET OF type.
419 */
420 asn_enc_rval_tcxx . . $ asn_enc_rval_t#
421 SET_OF_encode_dercxx . . $ SET_OF_encode_der(fa2fb5a8fffd167c).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *sptr,
422 int tag_mode, ber_tlv_tag_tcxx . . $ ber_tlv_tag_t# tag, asn_app_consume_bytes_fcxx . . $ asn_app_consume_bytes_f# *cb,
423 void *app_key) {
424 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.;
425 const asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list = _A_CSET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:66:9`!(sptr);
426 size_t computed_size = 0;
427 ssize_tcxx . . $ ssize_t# encoding_size = 0;
428 struct _el_buffercxx . . $ _el_buffer# *encoded_els;
429 int edx;
430
431 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Estimating size for SET OF %s", td->name);
432
433 /*
434 * Gather the length of the underlying members sequence.
435 */
436 for(edx = 0; edx < list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; edx++) {
437 void *memb_ptr = list->arraycxx . . $ $anonymous_type_9dabb0f578c92d03_0#array.[edx];
438 asn_enc_rval_tcxx . . $ asn_enc_rval_t# erval;
439
440 if(!memb_ptr) ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
441
442 erval =
443 elm->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->der_encodercxx . . $ asn_TYPE_operation_s#der_encoder.(elm->typecxx . . $ asn_TYPE_member_s#type., memb_ptr, 0, elm->tagcxx . . $ asn_TYPE_member_s#tag., 0, 0);
444 if(erval.encodedcxx . . $ asn_enc_rval_s#encoded. == -1) return erval;
445 computed_size += erval.encodedcxx . . $ asn_enc_rval_s#encoded.;
446 }
447
448
449 /*
450 * Encode the TLV for the sequence itself.
451 */
452 encoding_size =
453 der_write_tagscxx . . $ der_write_tags(7a366124af9c6c29).(td, computed_size, tag_mode, 1, tag, cb, app_key);
454 if(encoding_size < 0) {
455 ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
456 }
457 computed_size += encoding_size;
458
459 if(!cb || list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. == 0) {
460 asn_enc_rval_tcxx . . $ asn_enc_rval_t# erval;
461 erval.encodedcxx . . $ asn_enc_rval_s#encoded. = computed_size;
462 ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(erval);
463 }
464
465 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Encoding members of %s SET OF", td->name);
466
467 /*
468 * DER mandates dynamic sorting of the SET OF elements
469 * according to their encodings. Build an array of the
470 * encoded elements.
471 */
472 encoded_els = SET_OF__encode_sortedcxx . . $ SET_OF__encode_sorted(ea123826a6eb077c).(elm, list, SOES_DERcxx . . $ SOES_DER.);
473
474 /*
475 * Report encoded elements to the application.
476 * Dispose of temporary sorted members table.
477 */
478 for(edx = 0; edx < list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; edx++) {
479 struct _el_buffercxx . . $ _el_buffer# *encoded_el = &encoded_els[edx];
480 /* Report encoded chunks to the application */
481 if(cb(encoded_el->bufcxx . . $ _el_buffer#buf., encoded_el->lengthcxx . . $ _el_buffer#length., app_key) < 0) {
482 break;
483 } else {
484 encoding_size += encoded_el->lengthcxx . . $ _el_buffer#length.;
485 }
486 }
487
488 SET_OF__encode_sorted_freecxx . . $ SET_OF__encode_sorted_free(920be1e3a590e9a7).(encoded_els, list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.);
489
490 if(edx == list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.) {
491 asn_enc_rval_tcxx . . $ asn_enc_rval_t# erval;
492 assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(computed_size == (size_t)encoding_size);
493 erval.encodedcxx . . $ asn_enc_rval_s#encoded. = computed_size;
494 ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(erval);
495 } else {
496 ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
497 }
498 }
499
500 #undef XER_ADVANCE
501 #define XER_ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:501:9`!(num_bytes) do { \
502 size_t num = num_bytes; \
503 buf_ptr = ((const char *)buf_ptr) + num;\
504 size -= num; \
505 consumed_myself += num; \
506 } while(0)
507
508 /*
509 * Decode the XER (XML) data.
510 */
511 asn_dec_rval_tcxx . . $ asn_dec_rval_t#
512 SET_OF_decode_xercxx . . $ SET_OF_decode_xer(95123bf157631071).(const asn_codec_ctx_tcxx . . $ asn_codec_ctx_t# *opt_codec_ctx,
513 const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, void **struct_ptr,
514 const char *opt_mname, const void *buf_ptr, size_t size) {
515 /*
516 * Bring closer parts of structure description.
517 */
518 const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *specs = (const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *)td->specificscxx . . $ asn_TYPE_descriptor_s#specifics.;
519 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *element = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.;
520 const char *elm_tag;
521 const char *xml_tag = opt_mname ? opt_mname : td->xml_tagcxx . . $ asn_TYPE_descriptor_s#xml_tag.;
522
523 /*
524 * ... and parts of the structure being constructed.
525 */
526 void *st = *struct_ptr; /* Target structure. */
527 asn_struct_ctx_tcxx . . $ asn_struct_ctx_t# *ctx; /* Decoder context */
528
529 asn_dec_rval_tcxx . . $ asn_dec_rval_t# rval; /* Return value from a decoder */
530 ssize_tcxx . . $ ssize_t# consumed_myself = 0; /* Consumed bytes from ptr */
531
532 /*
533 * Create the target structure if it is not present already.
534 */
535 if(st == 0) {
536 st = *struct_ptr = CALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:33:9`!(1, specs->struct_size);
537 if(st == 0) RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
538 }
539
540 /* Which tag is expected for the downstream */
541 if(specs->as_XMLValueListcxx . . $ asn_SET_OF_specifics_s#as_XMLValueList.) {
542 elm_tag = (specs->as_XMLValueListcxx . . $ asn_SET_OF_specifics_s#as_XMLValueList. == 1) ? 0 : "";
543 } else {
544 elm_tag = (*element->namecxx . . $ asn_TYPE_member_s#name.)
545 ? element->namecxx . . $ asn_TYPE_member_s#name. : element->typecxx . . $ asn_TYPE_member_s#type.->xml_tagcxx . . $ asn_TYPE_descriptor_s#xml_tag.;
546 }
547
548 /*
549 * Restore parsing context.
550 */
551 ctx = (asn_struct_ctx_tcxx . . $ asn_struct_ctx_t# *)((char *)st + specs->ctx_offsetcxx . . $ asn_SET_OF_specifics_s#ctx_offset.);
552
553 /*
554 * Phases of XER/XML processing:
555 * Phase 0: Check that the opening tag matches our expectations.
556 * Phase 1: Processing body and reacting on closing tag.
557 * Phase 2: Processing inner type.
558 */
559 for(; ctx->phasecxx . . $ asn_struct_ctx_s#phase. <= 2;) {
560 pxer_chunk_type_ecxx . . $ pxer_chunk_type_e# ch_type; /* XER chunk type */
561 ssize_tcxx . . $ ssize_t# ch_size; /* Chunk size */
562 xer_check_tag_ecxx . . $ xer_check_tag_e# tcv; /* Tag check value */
563
564 /*
565 * Go inside the inner member of a set.
566 */
567 if(ctx->phasecxx . . $ asn_struct_ctx_s#phase. == 2) {
568 asn_dec_rval_tcxx . . $ asn_dec_rval_t# tmprval;
569
570 /* Invoke the inner type decoder, m.b. multiple times */
571 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("XER/SET OF element [%s]", elm_tag);
572 tmprval = element->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->xer_decodercxx . . $ asn_TYPE_operation_s#xer_decoder.(opt_codec_ctx,
573 element->typecxx . . $ asn_TYPE_member_s#type., &ctx->ptrcxx . . $ asn_struct_ctx_s#ptr., elm_tag,
574 buf_ptr, size);
575 if(tmprval.codecxx . . $ asn_dec_rval_s#code. == RC_OKcxx . . $ RC_OK.) {
576 asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list = _A_SET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:65:9`!(st);
577 if(ASN_SET_ADDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:30:9`!(list, ctx->ptr) != 0)
578 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
579 ctx->ptrcxx . . $ asn_struct_ctx_s#ptr. = 0;
580 XER_ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:501:9`!(tmprval.consumed);
581 } else {
582 XER_ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:501:9`!(tmprval.consumed);
583 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(tmprval.code);
584 }
585 ctx->phasecxx . . $ asn_struct_ctx_s#phase. = 1; /* Back to body processing */
586 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("XER/SET OF phase => %d", ctx->phase);
587 /* Fall through */
588 }
589
590 /*
591 * Get the next part of the XML stream.
592 */
593 ch_size = xer_next_tokencxx . . $ xer_next_token(78ca2a30630a9263).(&ctx->contextcxx . . $ asn_struct_ctx_s#context.,
594 buf_ptr, size, &ch_type);
595 if(ch_size == -1) {
596 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
597 } else {
598 switch(ch_type) {
599 case PXER_WMOREcxx . . $ PXER_WMORE.:
600 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_WMORE);
601 case PXER_COMMENTcxx . . $ PXER_COMMENT.: /* Got XML comment */
602 case PXER_TEXTcxx . . $ PXER_TEXT.: /* Ignore free-standing text */
603 XER_ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:501:9`!(ch_size); /* Skip silently */
604 continue;
605 case PXER_TAGcxx . . $ PXER_TAG.:
606 break; /* Check the rest down there */
607 }
608 }
609
610 tcv = xer_check_tagcxx . . $ xer_check_tag(162a3bf4fa0640e3).(buf_ptr, ch_size, xml_tag);
611 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("XER/SET OF: tcv = %d, ph=%d t=%s",
612 tcv, ctx->phase, xml_tag);
613 switch(tcv) {
614 case XCT_CLOSINGcxx . . $ XCT_CLOSING.:
615 if(ctx->phasecxx . . $ asn_struct_ctx_s#phase. == 0) break;
616 ctx->phasecxx . . $ asn_struct_ctx_s#phase. = 0;
617 /* Fall through */
618 case XCT_BOTHcxx . . $ XCT_BOTH.:
619 if(ctx->phasecxx . . $ asn_struct_ctx_s#phase. == 0) {
620 /* No more things to decode */
621 XER_ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:501:9`!(ch_size);
622 ctx->phasecxx . . $ asn_struct_ctx_s#phase. = 3; /* Phase out */
623 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_OK);
624 }
625 /* Fall through */
626 case XCT_OPENINGcxx . . $ XCT_OPENING.:
627 if(ctx->phasecxx . . $ asn_struct_ctx_s#phase. == 0) {
628 XER_ADVANCEcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:501:9`!(ch_size);
629 ctx->phasecxx . . $ asn_struct_ctx_s#phase. = 1; /* Processing body phase */
630 continue;
631 }
632 /* Fall through */
633 case XCT_UNKNOWN_OPcxx . . $ XCT_UNKNOWN_OP.:
634 case XCT_UNKNOWN_BOcxx . . $ XCT_UNKNOWN_BO.:
635
636 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase);
637 if(ctx->phasecxx . . $ asn_struct_ctx_s#phase. == 1) {
638 /*
639 * Process a single possible member.
640 */
641 ctx->phasecxx . . $ asn_struct_ctx_s#phase. = 2;
642 continue;
643 }
644 /* Fall through */
645 default:
646 break;
647 }
648
649 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Unexpected XML tag in SET OF");
650 break;
651 }
652
653 ctx->phasecxx . . $ asn_struct_ctx_s#phase. = 3; /* "Phase out" on hard failure */
654 RETURNcxx . . $ `lib/s1ap/asn1c/constr_SET_OF.c:59:9`!(RC_FAIL);
655 }
656
657
658
659 typedef struct xer_tmp_enc_scxx . . $ xer_tmp_enc_s# {
660 void *buffercxx . . $ xer_tmp_enc_s#buffer.;
661 size_t offsetcxx . . $ xer_tmp_enc_s#offset.;
662 size_t sizecxx . . $ xer_tmp_enc_s#size.;
663 } xer_tmp_enc_tcxx . . $ xer_tmp_enc_t#;
664 static int
665 SET_OF_encode_xer_callbackcxx . . $ SET_OF_encode_xer_callback(d5add74c253e2b79).(const void *buffer, size_t size, void *key) {
666 xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *t = (xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *)key;
667 if(t->offsetcxx . . $ xer_tmp_enc_s#offset. + size >= t->sizecxx . . $ xer_tmp_enc_s#size.) {
668 size_t newsize = (t->sizecxx . . $ xer_tmp_enc_s#size. << 2) + size;
669 void *p = REALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:35:9`!(t->buffer, newsize);
670 if(!p) return -1;
671 t->buffercxx . . $ xer_tmp_enc_s#buffer. = p;
672 t->sizecxx . . $ xer_tmp_enc_s#size. = newsize;
673 }
674 memcpycxx . . $ memcpy(cc817cb175f282d).((char *)t->buffercxx . . $ xer_tmp_enc_s#buffer. + t->offsetcxx . . $ xer_tmp_enc_s#offset., buffer, size);
675 t->offsetcxx . . $ xer_tmp_enc_s#offset. += size;
676 return 0;
677 }
678 static int
679 SET_OF_xer_ordercxx . . $ SET_OF_xer_order(9148c8c3ff42c9d8).(const void *aptr, const void *bptr) {
680 const xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *a = (const xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *)aptr;
681 const xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *b = (const xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *)bptr;
682 size_t minlen = a->offsetcxx . . $ xer_tmp_enc_s#offset.;
683 int ret;
684 if(b->offsetcxx . . $ xer_tmp_enc_s#offset. < minlen) minlen = b->offsetcxx . . $ xer_tmp_enc_s#offset.;
685 /* Well-formed UTF-8 has this nice lexicographical property... */
686 ret = memcmpcxx . . $ memcmp(36f949851efa3055).(a->buffercxx . . $ xer_tmp_enc_s#buffer., b->buffercxx . . $ xer_tmp_enc_s#buffer., minlen);
687 if(ret != 0) return ret;
688 if(a->offsetcxx . . $ xer_tmp_enc_s#offset. == b->offsetcxx . . $ xer_tmp_enc_s#offset.)
689 return 0;
690 if(a->offsetcxx . . $ xer_tmp_enc_s#offset. == minlen)
691 return -1;
692 return 1;
693 }
694
695
696 asn_enc_rval_tcxx . . $ asn_enc_rval_t#
697 SET_OF_encode_xercxx . . $ SET_OF_encode_xer(c4fdd6fdb096b316).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *sptr, int ilevel,
698 enum xer_encoder_flags_ecxx . . $ xer_encoder_flags_e# flags, asn_app_consume_bytes_fcxx . . $ asn_app_consume_bytes_f# *cb,
699 void *app_key) {
700 asn_enc_rval_tcxx . . $ asn_enc_rval_t# er;
701 const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *specs = (const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *)td->specificscxx . . $ asn_TYPE_descriptor_s#specifics.;
702 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.;
703 const asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list = _A_CSET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:66:9`!(sptr);
704 const char *mname = specs->as_XMLValueListcxx . . $ asn_SET_OF_specifics_s#as_XMLValueList.
705 ? 0 : ((*elm->namecxx . . $ asn_TYPE_member_s#name.) ? elm->namecxx . . $ asn_TYPE_member_s#name. : elm->typecxx . . $ asn_TYPE_member_s#type.->xml_tagcxx . . $ asn_TYPE_descriptor_s#xml_tag.);
706 size_t mlen = mname ? strlencxx . . $ strlen(751346f8406fd082).(mname) : 0;
707 int xcan = (flags & XER_F_CANONICALcxx . . $ XER_F_CANONICAL.);
708 xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *encs = 0;
709 size_t encs_count = 0;
710 void *original_app_key = app_key;
711 asn_app_consume_bytes_fcxx . . $ asn_app_consume_bytes_f# *original_cb = cb;
712 int i;
713
714 if(!sptr) ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
715
716 if(xcan) {
717 encs = (xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *)MALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:34:9`!(list->count * sizeof(encs[0]));
718 if(!encs) ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
719 cb = SET_OF_encode_xer_callbackcxx . . $ SET_OF_encode_xer_callback(d5add74c253e2b79).;
720 }
721
722 er.encodedcxx . . $ asn_enc_rval_s#encoded. = 0;
723
724 for(i = 0; i < list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; i++) {
725 asn_enc_rval_tcxx . . $ asn_enc_rval_t# tmper;
726
727 void *memb_ptr = list->arraycxx . . $ $anonymous_type_9dabb0f578c92d03_0#array.[i];
728 if(!memb_ptr) continue;
729
730 if(encs) {
731 memsetcxx . . $ memset(d1de1e4fb215f1c6).(&encs[encs_count], 0, sizeof(encs[0]));
732 app_key = &encs[encs_count];
733 encs_count++;
734 }
735
736 if(mname) {
737 if(!xcan) ASN__TEXT_INDENTcxx . . $ `lib/s1ap/asn1c/asn_internal.h:114:9`!(1, ilevel);
738 ASN__CALLBACK3cxx . . $ `lib/s1ap/asn1c/asn_internal.h:109:9`!("<", 1, mname, mlen, ">", 1);
739 }
740
741 if(!xcan && specs->as_XMLValueListcxx . . $ asn_SET_OF_specifics_s#as_XMLValueList. == 1)
742 ASN__TEXT_INDENTcxx . . $ `lib/s1ap/asn1c/asn_internal.h:114:9`!(1, ilevel + 1);
743 tmper = elm->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->xer_encodercxx . . $ asn_TYPE_operation_s#xer_encoder.(elm->typecxx . . $ asn_TYPE_member_s#type., memb_ptr,
744 ilevel + (specs->as_XMLValueListcxx . . $ asn_SET_OF_specifics_s#as_XMLValueList. != 2),
745 flags, cb, app_key);
746 if(tmper.encodedcxx . . $ asn_enc_rval_s#encoded. == -1) return tmper;
747 er.encodedcxx . . $ asn_enc_rval_s#encoded. += tmper.encodedcxx . . $ asn_enc_rval_s#encoded.;
748 if(tmper.encodedcxx . . $ asn_enc_rval_s#encoded. == 0 && specs->as_XMLValueListcxx . . $ asn_SET_OF_specifics_s#as_XMLValueList.) {
749 const char *name = elm->typecxx . . $ asn_TYPE_member_s#type.->xml_tagcxx . . $ asn_TYPE_descriptor_s#xml_tag.;
750 size_t len = strlencxx . . $ strlen(751346f8406fd082).(name);
751 ASN__CALLBACK3cxx . . $ `lib/s1ap/asn1c/asn_internal.h:109:9`!("<", 1, name, len, "/>", 2);
752 }
753
754 if(mname) {
755 ASN__CALLBACK3cxx . . $ `lib/s1ap/asn1c/asn_internal.h:109:9`!("</", 2, mname, mlen, ">", 1);
756 }
757
758 }
759
760 if(!xcan) ASN__TEXT_INDENTcxx . . $ `lib/s1ap/asn1c/asn_internal.h:114:9`!(1, ilevel - 1);
761
762 if(encs) {
763 xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *enc = encs;
764 xer_tmp_enc_tcxx . . $ xer_tmp_enc_t# *end = encs + encs_count;
765 ssize_tcxx . . $ ssize_t# control_size = 0;
766
767 er.encodedcxx . . $ asn_enc_rval_s#encoded. = 0;
768 cb = original_cb;
769 app_key = original_app_key;
770 qsortcxx . . $ qsort(ebb60b13a65e77d7).(encs, encs_count, sizeof(encs[0]), SET_OF_xer_ordercxx . . $ SET_OF_xer_order(9148c8c3ff42c9d8).);
771
772 for(; enc < end; enc++) {
773 ASN__CALLBACKcxx . . $ `lib/s1ap/asn1c/asn_internal.h:105:9`!(enc->buffer, enc->offset);
774 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(enc->buffer);
775 enc->buffercxx . . $ xer_tmp_enc_s#buffer. = 0;
776 control_size += enc->offsetcxx . . $ xer_tmp_enc_s#offset.;
777 }
778 assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(control_size == er.encoded);
779 }
780
781 goto cleanup;
782 cb_failed:
783 ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
784 cleanup:
785 if(encs) {
786 size_t n;
787 for(n = 0; n < encs_count; n++) {
788 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(encs[n].buffer);
789 }
790 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(encs);
791 }
792 ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(er);
793 }
794
795 int
796 SET_OF_printcxx . . $ SET_OF_print(f90cfeb3746557fe).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *sptr, int ilevel,
797 asn_app_consume_bytes_fcxx . . $ asn_app_consume_bytes_f# *cb, void *app_key) {
798 asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.;
799 const asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list = _A_CSET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:66:9`!(sptr);
800 int ret;
801 int i;
802
803 if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
804
805 /* Dump preamble */
806 if(cb(td->namecxx . . $ asn_TYPE_descriptor_s#name., strlencxx . . $ strlen(751346f8406fd082).(td->namecxx . . $ asn_TYPE_descriptor_s#name.), app_key) < 0
807 || cb(" ::= {", 6, app_key) < 0)
808 return -1;
809
810 for(i = 0; i < list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; i++) {
811 const void *memb_ptr = list->arraycxx . . $ $anonymous_type_9dabb0f578c92d03_0#array.[i];
812 if(!memb_ptr) continue;
813
814 _i_INDENTcxx . . $ `lib/s1ap/asn1c/asn_internal.h:124:9`!(1);
815
816 ret = elm->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->print_structcxx . . $ asn_TYPE_operation_s#print_struct.(elm->typecxx . . $ asn_TYPE_member_s#type., memb_ptr,
817 ilevel + 1, cb, app_key);
818 if(ret) return ret;
819 }
820
821 ilevel--;
822 _i_INDENTcxx . . $ `lib/s1ap/asn1c/asn_internal.h:124:9`!(1);
823
824 return (cb("}", 1, app_key) < 0) ? -1 : 0;
825 }
826
827 void
828 SET_OF_freecxx . . $ SET_OF_free(d934c6f1aa2db56).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, void *ptr,
829 enum asn_struct_free_methodcxx . . $ asn_struct_free_method# method) {
830 if(td && ptr) {
831 const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *specs;
832 asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.;
833 asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list = _A_SET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:65:9`!(ptr);
834 asn_struct_ctx_tcxx . . $ asn_struct_ctx_t# *ctx; /* Decoder context */
835 int i;
836
837 /*
838 * Could not use set_of_empty() because of (*free)
839 * incompatibility.
840 */
841 for(i = 0; i < list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; i++) {
842 void *memb_ptr = list->arraycxx . . $ $anonymous_type_9dabb0f578c92d03_0#array.[i];
843 if(memb_ptr)
844 ASN_STRUCT_FREEcxx . . $ `lib/s1ap/asn1c/constr_TYPE.h:72:9`!(*elm->type, memb_ptr);
845 }
846 list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. = 0; /* No meaningful elements left */
847
848 asn_set_emptycxx . . $ asn_set_empty(5d22bdacc48458e8).(list); /* Remove (list->array) */
849
850 specs = (const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *)td->specificscxx . . $ asn_TYPE_descriptor_s#specifics.;
851 ctx = (asn_struct_ctx_tcxx . . $ asn_struct_ctx_t# *)((char *)ptr + specs->ctx_offsetcxx . . $ asn_SET_OF_specifics_s#ctx_offset.);
852 if(ctx->ptrcxx . . $ asn_struct_ctx_s#ptr.) {
853 ASN_STRUCT_FREEcxx . . $ `lib/s1ap/asn1c/constr_TYPE.h:72:9`!(*elm->type, ctx->ptr);
854 ctx->ptrcxx . . $ asn_struct_ctx_s#ptr. = 0;
855 }
856
857 switch(method) {
858 case ASFM_FREE_EVERYTHINGcxx . . $ ASFM_FREE_EVERYTHING.:
859 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(ptr);
860 break;
861 case ASFM_FREE_UNDERLYINGcxx . . $ ASFM_FREE_UNDERLYING.:
862 break;
863 case ASFM_FREE_UNDERLYING_AND_RESETcxx . . $ ASFM_FREE_UNDERLYING_AND_RESET.:
864 memsetcxx . . $ memset(d1de1e4fb215f1c6).(ptr, 0, specs->struct_sizecxx . . $ asn_SET_OF_specifics_s#struct_size.);
865 break;
866 }
867 }
868 }
869
870 int
871 SET_OF_constraintcxx . . $ SET_OF_constraint(f655700a27bffd74).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *sptr,
872 asn_app_constraint_failed_fcxx . . $ asn_app_constraint_failed_f# *ctfailcb, void *app_key) {
873 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.;
874 asn_constr_check_fcxx . . $ asn_constr_check_f# *constr;
875 const asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list = _A_CSET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:66:9`!(sptr);
876 int i;
877
878 if(!sptr) {
879 ASN__CTFAILcxx . . $ `lib/s1ap/asn1c/constraints.h:56:9`!(app_key, td, sptr,
880 "%s: value not given (%s:%d)",
881 td->namecxx . . $ asn_TYPE_descriptor_s#name., __FILE__, __LINE__);
882 return -1;
883 }
884
885 constr = elm->encoding_constraintscxx . . $ asn_TYPE_member_s#encoding_constraints..general_constraintscxx . . $ asn_encoding_constraints_s#general_constraints.;
886 if(!constr) constr = elm->typecxx . . $ asn_TYPE_member_s#type.->encoding_constraintscxx . . $ asn_TYPE_descriptor_s#encoding_constraints..general_constraintscxx . . $ asn_encoding_constraints_s#general_constraints.;
887
888 /*
889 * Iterate over the members of an array.
890 * Validate each in turn, until one fails.
891 */
892 for(i = 0; i < list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; i++) {
893 const void *memb_ptr = list->arraycxx . . $ $anonymous_type_9dabb0f578c92d03_0#array.[i];
894 int ret;
895
896 if(!memb_ptr) continue;
897
898 ret = constr(elm->typecxx . . $ asn_TYPE_member_s#type., memb_ptr, ctfailcb, app_key);
899 if(ret) return ret;
900 }
901
902 return 0;
903 }
904
905 #ifndef ASN_DISABLE_PER_SUPPORT
906
907 asn_dec_rval_tcxx . . $ asn_dec_rval_t#
908 SET_OF_decode_upercxx . . $ SET_OF_decode_uper(e6a06374f784e2a6).(const asn_codec_ctx_tcxx . . $ asn_codec_ctx_t# *opt_codec_ctx,
909 const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td,
910 const asn_per_constraints_tcxx . . $ asn_per_constraints_t# *constraints, void **sptr,
911 asn_per_data_tcxx . . $ asn_per_data_t# *pd) {
912 asn_dec_rval_tcxx . . $ asn_dec_rval_t# rv;
913 const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *specs = (const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *)td->specificscxx . . $ asn_TYPE_descriptor_s#specifics.;
914 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.; /* Single one */
915 void *st = *sptr;
916 asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list;
917 const asn_per_constraint_tcxx . . $ asn_per_constraint_t# *ct;
918 int repeat = 0;
919 ssize_tcxx . . $ ssize_t# nelems;
920
921 if(ASN__STACK_OVERFLOW_CHECKcxx . . $ ASN__STACK_OVERFLOW_CHECK(2187b259efbd271d).(opt_codec_ctx))
922 ASN__DECODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:90:9`!;
923
924 /*
925 * Create the target structure if it is not present already.
926 */
927 if(!st) {
928 st = *sptr = CALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:33:9`!(1, specs->struct_size);
929 if(!st) ASN__DECODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:90:9`!;
930 }
931 list = _A_SET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:65:9`!(st);
932
933 /* Figure out which constraints to use */
934 if(constraints) ct = &constraints->sizecxx . . $ asn_per_constraints_s#size.;
935 else if(td->encoding_constraintscxx . . $ asn_TYPE_descriptor_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.)
936 ct = &td->encoding_constraintscxx . . $ asn_TYPE_descriptor_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.->sizecxx . . $ asn_per_constraints_s#size.;
937 else ct = 0;
938
939 if(ct && ct->flagscxx . . $ asn_per_constraint_s#flags. & APC_EXTENSIBLEcxx . . $ APC_EXTENSIBLE.) {
940 int value = per_get_few_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:39:9`!(pd, 1);
941 if(value < 0) ASN__DECODE_STARVEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:97:9`!;
942 if(value) ct = 0; /* Not restricted! */
943 }
944
945 if(ct && ct->effective_bitscxx . . $ asn_per_constraint_s#effective_bits. >= 0) {
946 /* X.691, #19.5: No length determinant */
947 nelems = per_get_few_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:39:9`!(pd, ct->effective_bits);
948 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Preparing to fetch %ld+%ld elements from %s",
949 (long)nelems, ct->lower_bound, td->name);
950 if(nelems < 0) ASN__DECODE_STARVEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:97:9`!;
951 nelems += ct->lower_boundcxx . . $ asn_per_constraint_s#lower_bound.;
952 } else {
953 nelems = -1;
954 }
955
956 do {
957 int i;
958 if(nelems < 0) {
959 nelems = uper_get_lengthcxx . . $ uper_get_length(14d590abbb3d316b).(pd, -1, 0, &repeat);
960 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Got to decode %" ASN_PRI_SSIZE " elements (eff %d)",
961 nelems, (int)(ct ? ct->effective_bits : -1));
962 if(nelems < 0) ASN__DECODE_STARVEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:97:9`!;
963 }
964
965 for(i = 0; i < nelems; i++) {
966 void *ptr = 0;
967 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("SET OF %s decoding", elm->type->name);
968 rv = elm->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->uper_decodercxx . . $ asn_TYPE_operation_s#uper_decoder.(opt_codec_ctx, elm->typecxx . . $ asn_TYPE_member_s#type.,
969 elm->encoding_constraintscxx . . $ asn_TYPE_member_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints., &ptr, pd);
970 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("%s SET OF %s decoded %d, %p",
971 td->name, elm->type->name, rv.code, ptr);
972 if(rv.codecxx . . $ asn_dec_rval_s#code. == RC_OKcxx . . $ RC_OK.) {
973 if(ASN_SET_ADDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:30:9`!(list, ptr) == 0) {
974 if(rv.consumedcxx . . $ asn_dec_rval_s#consumed. == 0 && nelems > 200) {
975 /* Protect from SET OF NULL compression bombs. */
976 ASN__DECODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:90:9`!;
977 }
978 continue;
979 }
980 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Failed to add element into %s",
981 td->name);
982 /* Fall through */
983 rv.codecxx . . $ asn_dec_rval_s#code. = RC_FAILcxx . . $ RC_FAIL.;
984 } else {
985 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Failed decoding %s of %s (SET OF)",
986 elm->type->name, td->name);
987 }
988 if(ptr) ASN_STRUCT_FREEcxx . . $ `lib/s1ap/asn1c/constr_TYPE.h:72:9`!(*elm->type, ptr);
989 return rv;
990 }
991
992 nelems = -1; /* Allow uper_get_length() */
993 } while(repeat);
994
995 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Decoded %s as SET OF", td->name);
996
997 rv.codecxx . . $ asn_dec_rval_s#code. = RC_OKcxx . . $ RC_OK.;
998 rv.consumedcxx . . $ asn_dec_rval_s#consumed. = 0;
999 return rv;
1000 }
1001
1002 asn_enc_rval_tcxx . . $ asn_enc_rval_t#
1003 SET_OF_encode_upercxx . . $ SET_OF_encode_uper(1e553b888c3dcd43).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td,
1004 const asn_per_constraints_tcxx . . $ asn_per_constraints_t# *constraints, const void *sptr,
1005 asn_per_outp_tcxx . . $ asn_per_outp_t# *po) {
1006 const asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list;
1007 const asn_per_constraint_tcxx . . $ asn_per_constraint_t# *ct;
1008 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.;
1009 struct _el_buffercxx . . $ _el_buffer# *encoded_els;
1010 asn_enc_rval_tcxx . . $ asn_enc_rval_t# er;
1011 size_t encoded_edx;
1012
1013 if(!sptr) ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
1014
1015 list = _A_CSET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:66:9`!(sptr);
1016
1017 er.encodedcxx . . $ asn_enc_rval_s#encoded. = 0;
1018
1019 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Encoding %s as SEQUENCE OF (%d)", td->name, list->count);
1020
1021 if(constraints) ct = &constraints->sizecxx . . $ asn_per_constraints_s#size.;
1022 else if(td->encoding_constraintscxx . . $ asn_TYPE_descriptor_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.)
1023 ct = &td->encoding_constraintscxx . . $ asn_TYPE_descriptor_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.->sizecxx . . $ asn_per_constraints_s#size.;
1024 else ct = 0;
1025
1026 /* If extensible constraint, check if size is in root */
1027 if(ct) {
1028 int not_in_root =
1029 (list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. < ct->lower_boundcxx . . $ asn_per_constraint_s#lower_bound. || list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. > ct->upper_boundcxx . . $ asn_per_constraint_s#upper_bound.);
1030 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("lb %ld ub %ld %s", ct->lower_bound, ct->upper_bound,
1031 ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
1032 if(ct->flagscxx . . $ asn_per_constraint_s#flags. & APC_EXTENSIBLEcxx . . $ APC_EXTENSIBLE.) {
1033 /* Declare whether size is in extension root */
1034 if(per_put_few_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:72:9`!(po, not_in_root, 1)) ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
1035 if(not_in_root) ct = 0;
1036 } else if(not_in_root && ct->effective_bitscxx . . $ asn_per_constraint_s#effective_bits. >= 0) {
1037 ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
1038 }
1039
1040 }
1041
1042 if(ct && ct->effective_bitscxx . . $ asn_per_constraint_s#effective_bits. >= 0) {
1043 /* X.691, #19.5: No length determinant */
1044 if(per_put_few_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:72:9`!(po, list->count - ct->lower_bound,
1045 ct->effective_bits))
1046 ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
1047 } else if(list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. == 0) {
1048 /* When the list is empty add only the length determinant
1049 * X.691, #20.6 and #11.9.4.1
1050 */
1051 if (uper_put_lengthcxx . . $ uper_put_length(8430978b5e735d38).(po, 0, 0)) {
1052 ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
1053 }
1054 ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(er);
1055 }
1056
1057
1058 /*
1059 * Canonical UPER #22.1 mandates dynamic sorting of the SET OF elements
1060 * according to their encodings. Build an array of the encoded elements.
1061 */
1062 encoded_els = SET_OF__encode_sortedcxx . . $ SET_OF__encode_sorted(ea123826a6eb077c).(elm, list, SOES_CUPERcxx . . $ SOES_CUPER.);
1063
1064 for(encoded_edx = 0; (ssize_tcxx . . $ ssize_t#)encoded_edx < list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.;) {
1065 ssize_tcxx . . $ ssize_t# may_encode;
1066 size_t edx;
1067 int need_eom = 0;
1068
1069 if(ct && ct->effective_bitscxx . . $ asn_per_constraint_s#effective_bits. >= 0) {
1070 may_encode = list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.;
1071 } else {
1072 may_encode =
1073 uper_put_lengthcxx . . $ uper_put_length(8430978b5e735d38).(po, list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. - encoded_edx, &need_eom);
1074 if(may_encode < 0) ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
1075 }
1076
1077 for(edx = encoded_edx; edx < encoded_edx + may_encode; edx++) {
1078 const struct _el_buffercxx . . $ _el_buffer# *el = &encoded_els[edx];
1079 if(asn_put_many_bitscxx . . $ asn_put_many_bits(d373bafe0808586c).(po, el->bufcxx . . $ _el_buffer#buf.,
1080 (8 * el->lengthcxx . . $ _el_buffer#length.) - el->bits_unusedcxx . . $ _el_buffer#bits_unused.) < 0) {
1081 break;
1082 }
1083 }
1084
1085 if(need_eom && uper_put_lengthcxx . . $ uper_put_length(8430978b5e735d38).(po, 0, 0))
1086 ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!; /* End of Message length */
1087
1088 encoded_edx += may_encode;
1089 }
1090
1091 SET_OF__encode_sorted_freecxx . . $ SET_OF__encode_sorted_free(920be1e3a590e9a7).(encoded_els, list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.);
1092
1093 if((ssize_tcxx . . $ ssize_t#)encoded_edx == list->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.) {
1094 ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(er);
1095 } else {
1096 ASN__ENCODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:59:9`!;
1097 }
1098 }
1099
1100 asn_dec_rval_tcxx . . $ asn_dec_rval_t#
1101 SET_OF_decode_apercxx . . $ SET_OF_decode_aper(e6a06374f784e2a6).(const asn_codec_ctx_tcxx . . $ asn_codec_ctx_t# *opt_codec_ctx,
1102 const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td,
1103 const asn_per_constraints_tcxx . . $ asn_per_constraints_t# *constraints, void **sptr, asn_per_data_tcxx . . $ asn_per_data_t# *pd) {
1104 asn_dec_rval_tcxx . . $ asn_dec_rval_t# rv;
1105 const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *specs = (const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *)td->specificscxx . . $ asn_TYPE_descriptor_s#specifics.;
1106 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.; /* Single one */
1107 void *st = *sptr;
1108 asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list;
1109 const asn_per_constraint_tcxx . . $ asn_per_constraint_t# *ct;
1110 int repeat = 0;
1111 ssize_tcxx . . $ ssize_t# nelems;
1112
1113 if(ASN__STACK_OVERFLOW_CHECKcxx . . $ ASN__STACK_OVERFLOW_CHECK(2187b259efbd271d).(opt_codec_ctx))
1114 ASN__DECODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:90:9`!;
1115
1116 /*
1117 * Create the target structure if it is not present already.
1118 */
1119 if(!st) {
1120 st = *sptr = CALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:33:9`!(1, specs->struct_size);
1121 if(!st) ASN__DECODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:90:9`!;
1122 }
1123 list = _A_SET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:65:9`!(st);
1124
1125 /* Figure out which constraints to use */
1126 if(constraints) ct = &constraints->sizecxx . . $ asn_per_constraints_s#size.;
1127 else if(td->encoding_constraintscxx . . $ asn_TYPE_descriptor_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.)
1128 ct = &td->encoding_constraintscxx . . $ asn_TYPE_descriptor_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.->sizecxx . . $ asn_per_constraints_s#size.;
1129 else ct = 0;
1130
1131 if(ct && ct->flagscxx . . $ asn_per_constraint_s#flags. & APC_EXTENSIBLEcxx . . $ APC_EXTENSIBLE.) {
1132 int value = per_get_few_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:39:9`!(pd, 1);
1133 if(value < 0) ASN__DECODE_STARVEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:97:9`!;
1134 if(value) ct = 0; /* Not restricted! */
1135 }
1136
1137 if(ct && ct->effective_bitscxx . . $ asn_per_constraint_s#effective_bits. >= 0) {
1138 /* X.691, #19.5: No length determinant */
1139 nelems = aper_get_nsnnwncxx . . $ aper_get_nsnnwn(b5fa03b2df232cb2).(pd, ct->upper_boundcxx . . $ asn_per_constraint_s#upper_bound. - ct->lower_boundcxx . . $ asn_per_constraint_s#lower_bound. + 1);
1140 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Preparing to fetch %ld+%ld elements from %s",
1141 (long)nelems, ct->lower_bound, td->name);
1142 if(nelems < 0) ASN__DECODE_STARVEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:97:9`!;
1143 nelems += ct->lower_boundcxx . . $ asn_per_constraint_s#lower_bound.;
1144 } else {
1145 nelems = -1;
1146 }
1147
1148 do {
1149 int i;
1150 if(nelems < 0) {
1151 nelems = aper_get_lengthcxx . . $ aper_get_length(f83e194f1de67789).(pd, ct ? ct->upper_boundcxx . . $ asn_per_constraint_s#upper_bound. - ct->lower_boundcxx . . $ asn_per_constraint_s#lower_bound. + 1 : -1,
1152 ct ? ct->effective_bitscxx . . $ asn_per_constraint_s#effective_bits. : -1, &repeat);
1153 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Got to decode %d elements (eff %d)",
1154 (int)nelems, (int)(ct ? ct->effective_bits : -1));
1155 if(nelems < 0) ASN__DECODE_STARVEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:97:9`!;
1156 }
1157
1158 for(i = 0; i < nelems; i++) {
1159 void *ptr = 0;
1160 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("SET OF %s decoding", elm->type->name);
1161 rv = elm->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->aper_decodercxx . . $ asn_TYPE_operation_s#aper_decoder.(opt_codec_ctx, elm->typecxx . . $ asn_TYPE_member_s#type.,
1162 elm->encoding_constraintscxx . . $ asn_TYPE_member_s#encoding_constraints..per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints., &ptr, pd);
1163 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("%s SET OF %s decoded %d, %p",
1164 td->name, elm->type->name, rv.code, ptr);
1165 if(rv.codecxx . . $ asn_dec_rval_s#code. == RC_OKcxx . . $ RC_OK.) {
1166 if(ASN_SET_ADDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:30:9`!(list, ptr) == 0)
1167 continue;
1168 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Failed to add element into %s",
1169 td->name);
1170 /* Fall through */
1171 rv.codecxx . . $ asn_dec_rval_s#code. = RC_FAILcxx . . $ RC_FAIL.;
1172 } else {
1173 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Failed decoding %s of %s (SET OF)",
1174 elm->type->name, td->name);
1175 }
1176 if(ptr) ASN_STRUCT_FREEcxx . . $ `lib/s1ap/asn1c/constr_TYPE.h:72:9`!(*elm->type, ptr);
1177 return rv;
1178 }
1179
1180 nelems = -1; /* Allow uper_get_length() */
1181 } while(repeat);
1182
1183 ASN_DEBUGcxx . . $ `lib/s1ap/asn1c/asn_internal.h:76:9`!("Decoded %s as SET OF", td->name);
1184
1185 rv.codecxx . . $ asn_dec_rval_s#code. = RC_OKcxx . . $ RC_OK.;
1186 rv.consumedcxx . . $ asn_dec_rval_s#consumed. = 0;
1187 return rv;
1188 }
1189
1190 #endif /* ASN_DISABLE_PER_SUPPORT */
1191
1192 struct comparable_ptrcxx . . $ comparable_ptr# {
1193 const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *tdcxx . . $ comparable_ptr#td.;
1194 const void *sptrcxx . . $ comparable_ptr#sptr.;
1195 };
1196
1197 static int
1198 SET_OF__compare_cbcxx . . $ SET_OF__compare_cb(9148c8c3ff42c9d8).(const void *aptr, const void *bptr) {
1199 const struct comparable_ptrcxx . . $ comparable_ptr# *a = aptr;
1200 const struct comparable_ptrcxx . . $ comparable_ptr# *b = bptr;
1201 assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(a->td == b->td);
1202 return a->tdcxx . . $ comparable_ptr#td.->opcxx . . $ asn_TYPE_descriptor_s#op.->compare_structcxx . . $ asn_TYPE_operation_s#compare_struct.(a->tdcxx . . $ comparable_ptr#td., a->sptrcxx . . $ comparable_ptr#sptr., b->sptrcxx . . $ comparable_ptr#sptr.);
1203 }
1204
1205 int
1206 SET_OF_comparecxx . . $ SET_OF_compare(bd6c17b928321db4).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *aptr,
1207 const void *bptr) {
1208 const asn_anonymous_set_cxx . . $ asn_anonymous_set_# *a = _A_CSET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:66:9`!(aptr);
1209 const asn_anonymous_set_cxx . . $ asn_anonymous_set_# *b = _A_CSET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:66:9`!(bptr);
1210
1211 if(a && b) {
1212 struct comparable_ptrcxx . . $ comparable_ptr# *asorted;
1213 struct comparable_ptrcxx . . $ comparable_ptr# *bsorted;
1214 ssize_tcxx . . $ ssize_t# common_length;
1215 ssize_tcxx . . $ ssize_t# idx;
1216
1217 if(a->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. == 0) {
1218 if(b->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.) return -1;
1219 return 0;
1220 } else if(b->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. == 0) {
1221 return 1;
1222 }
1223
1224 asorted = MALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:34:9`!(a->count * sizeof(asorted[0]));
1225 bsorted = MALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:34:9`!(b->count * sizeof(bsorted[0]));
1226 if(!asorted || !bsorted) {
1227 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(asorted);
1228 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(bsorted);
1229 return -1;
1230 }
1231
1232 for(idx = 0; idx < a->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; idx++) {
1233 asorted[idx].tdcxx . . $ comparable_ptr#td. = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.->typecxx . . $ asn_TYPE_member_s#type.;
1234 asorted[idx].sptrcxx . . $ comparable_ptr#sptr. = a->arraycxx . . $ $anonymous_type_9dabb0f578c92d03_0#array.[idx];
1235 }
1236
1237 for(idx = 0; idx < b->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.; idx++) {
1238 bsorted[idx].tdcxx . . $ comparable_ptr#td. = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.->typecxx . . $ asn_TYPE_member_s#type.;
1239 bsorted[idx].sptrcxx . . $ comparable_ptr#sptr. = b->arraycxx . . $ $anonymous_type_9dabb0f578c92d03_0#array.[idx];
1240 }
1241
1242 qsortcxx . . $ qsort(ebb60b13a65e77d7).(asorted, a->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count., sizeof(asorted[0]), SET_OF__compare_cbcxx . . $ SET_OF__compare_cb(9148c8c3ff42c9d8).);
1243 qsortcxx . . $ qsort(ebb60b13a65e77d7).(bsorted, b->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count., sizeof(bsorted[0]), SET_OF__compare_cbcxx . . $ SET_OF__compare_cb(9148c8c3ff42c9d8).);
1244
1245 common_length = (a->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. < b->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. ? a->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count. : b->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.);
1246 for(idx = 0; idx < common_length; idx++) {
1247 int ret = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->compare_structcxx . . $ asn_TYPE_operation_s#compare_struct.(
1248 td->elementscxx . . $ asn_TYPE_descriptor_s#elements.->typecxx . . $ asn_TYPE_member_s#type., asorted[idx].sptrcxx . . $ comparable_ptr#sptr., bsorted[idx].sptrcxx . . $ comparable_ptr#sptr.);
1249 if(ret) {
1250 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(asorted);
1251 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(bsorted);
1252 return ret;
1253 }
1254 }
1255
1256 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(asorted);
1257 FREEMEMcxx . . $ `lib/s1ap/asn1c/asn_internal.h:36:9`!(bsorted);
1258
1259 if(idx < b->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.) /* more elements in b */
1260 return -1; /* a is shorter, so put it first */
1261 if(idx < a->countcxx . . $ $anonymous_type_9dabb0f578c92d03_0#count.) return 1;
1262 } else if(!a) {
1263 return -1;
1264 } else if(!b) {
1265 return 1;
1266 }
1267
1268 return 0;
1269 }
1270
1271
1272 asn_TYPE_operation_tcxx . . $ asn_TYPE_operation_t# asn_OP_SET_OFcxx . . $ asn_OP_SET_OF. = {
1273 SET_OF_freecxx . . $ SET_OF_free(d934c6f1aa2db56).,
1274 SET_OF_printcxx . . $ SET_OF_print(f90cfeb3746557fe).,
1275 SET_OF_comparecxx . . $ SET_OF_compare(bd6c17b928321db4).,
1276 SET_OF_decode_bercxx . . $ SET_OF_decode_ber(96f9c71a4eda4f59).,
1277 SET_OF_encode_dercxx . . $ SET_OF_encode_der(fa2fb5a8fffd167c).,
1278 SET_OF_decode_xercxx . . $ SET_OF_decode_xer(95123bf157631071).,
1279 SET_OF_encode_xercxx . . $ SET_OF_encode_xer(c4fdd6fdb096b316).,
1280 #ifdef ASN_DISABLE_OER_SUPPORT
1281 0,
1282 0,
1283 #else
1284 SET_OF_decode_oercxx . . $ SET_OF_decode_oer(7e0840003868e3f).,
1285 SET_OF_encode_oercxx . . $ SET_OF_encode_oer(f4853efe7f383924).,
1286 #endif
1287 #ifdef ASN_DISABLE_PER_SUPPORT
1288 0,
1289 0,
1290 0,
1291 0,
1292 #else
1293 SET_OF_decode_upercxx . . $ SET_OF_decode_uper(e6a06374f784e2a6).,
1294 SET_OF_encode_upercxx . . $ SET_OF_encode_uper(1e553b888c3dcd43).,
1295 SET_OF_decode_apercxx . . $ SET_OF_decode_aper(e6a06374f784e2a6).,
1296 0, /* SET_OF_encode_aper */
1297 #endif /* ASN_DISABLE_PER_SUPPORT */
1298 SET_OF_random_fillcxx . . $ SET_OF_random_fill(a4913c4af30a153b).,
1299 0 /* Use generic outmost tag fetcher */
1300 };
1301
1302
1303 asn_random_fill_result_tcxx . . $ asn_random_fill_result_t#
1304 SET_OF_random_fillcxx . . $ SET_OF_random_fill(a4913c4af30a153b).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, void **sptr,
1305 const asn_encoding_constraints_tcxx . . $ asn_encoding_constraints_t# *constraints,
1306 size_t max_length) {
1307 const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *specs =
1308 (const asn_SET_OF_specifics_tcxx . . $ asn_SET_OF_specifics_t# *)td->specificscxx . . $ asn_TYPE_descriptor_s#specifics.;
1309 asn_random_fill_result_tcxx . . $ asn_random_fill_result_t# res_ok = {ARFILL_OKcxx . . $ asn_random_fill_result_s#ARFILL_OK., 0};
1310 asn_random_fill_result_tcxx . . $ asn_random_fill_result_t# result_failed = {ARFILL_FAILEDcxx . . $ asn_random_fill_result_s#ARFILL_FAILED., 0};
1311 asn_random_fill_result_tcxx . . $ asn_random_fill_result_t# result_skipped = {ARFILL_SKIPPEDcxx . . $ asn_random_fill_result_s#ARFILL_SKIPPED., 0};
1312 const asn_TYPE_member_tcxx . . $ asn_TYPE_member_t# *elm = td->elementscxx . . $ asn_TYPE_descriptor_s#elements.;
1313 void *st = *sptr;
1314 long max_elements = 5;
1315 long slb = 0; /* Lower size bound */
1316 long sub = 0; /* Upper size bound */
1317 size_t rnd_len;
1318
1319 if(max_length == 0) return result_skipped;
1320
1321 if(st == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
1322 st = (*sptr = CALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:33:9`!(1, specs->struct_size));
1323 if(st == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
1324 return result_failed;
1325 }
1326 }
1327
1328 switch(asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(0, 6)) {
1329 case 0: max_elements = 0; break;
1330 case 1: max_elements = 1; break;
1331 case 2: max_elements = 5; break;
1332 case 3: max_elements = max_length; break;
1333 case 4: max_elements = max_length / 2; break;
1334 case 5: max_elements = max_length / 4; break;
1335 default: break;
1336 }
1337 sub = slb + max_elements;
1338
1339 if(!constraints || !constraints->per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.)
1340 constraints = &td->encoding_constraintscxx . . $ asn_TYPE_descriptor_s#encoding_constraints.;
1341 if(constraints->per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.) {
1342 const asn_per_constraint_tcxx . . $ asn_per_constraint_t# *pc = &constraints->per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.->sizecxx . . $ asn_per_constraints_s#size.;
1343 if(pc->flagscxx . . $ asn_per_constraint_s#flags. & APC_SEMI_CONSTRAINEDcxx . . $ APC_SEMI_CONSTRAINED.) {
1344 slb = pc->lower_boundcxx . . $ asn_per_constraint_s#lower_bound.;
1345 sub = pc->lower_boundcxx . . $ asn_per_constraint_s#lower_bound. + max_elements;
1346 } else if(pc->flagscxx . . $ asn_per_constraint_s#flags. & APC_CONSTRAINEDcxx . . $ APC_CONSTRAINED.) {
1347 slb = pc->lower_boundcxx . . $ asn_per_constraint_s#lower_bound.;
1348 sub = pc->upper_boundcxx . . $ asn_per_constraint_s#upper_bound.;
1349 if(sub - slb > max_elements) sub = slb + max_elements;
1350 }
1351 }
1352
1353 /* Bias towards edges of allowed space */
1354 switch(asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(-1, 4)) {
1355 default:
1356 case -1:
1357 /* Prepare lengths somewhat outside of constrained range. */
1358 if(constraints->per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.
1359 && (constraints->per_constraintscxx . . $ asn_encoding_constraints_s#per_constraints.->sizecxx . . $ asn_per_constraints_s#size..flagscxx . . $ asn_per_constraint_s#flags. & APC_EXTENSIBLEcxx . . $ APC_EXTENSIBLE.)) {
1360 switch(asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(0, 5)) {
1361 default:
1362 case 0:
1363 rnd_len = 0;
1364 break;
1365 case 1:
1366 if(slb > 0) {
1367 rnd_len = slb - 1;
1368 } else {
1369 rnd_len = 0;
1370 }
1371 break;
1372 case 2:
1373 rnd_len = asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(0, slb);
1374 break;
1375 case 3:
1376 if(sub < (ssize_tcxx . . $ ssize_t#)max_length) {
1377 rnd_len = sub + 1;
1378 } else {
1379 rnd_len = max_length;
1380 }
1381 break;
1382 case 4:
1383 if(sub < (ssize_tcxx . . $ ssize_t#)max_length) {
1384 rnd_len = asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(sub + 1, max_length);
1385 } else {
1386 rnd_len = max_length;
1387 }
1388 break;
1389 case 5:
1390 rnd_len = max_length;
1391 break;
1392 }
1393 break;
1394 }
1395 /* Fall through */
1396 case 0:
1397 rnd_len = asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(slb, sub);
1398 break;
1399 case 1:
1400 if(slb < sub) {
1401 rnd_len = asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(slb + 1, sub);
1402 break;
1403 }
1404 /* Fall through */
1405 case 2:
1406 rnd_len = asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(slb, slb);
1407 break;
1408 case 3:
1409 if(slb < sub) {
1410 rnd_len = asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(slb, sub - 1);
1411 break;
1412 }
1413 /* Fall through */
1414 case 4:
1415 rnd_len = asn_random_betweencxx . . $ asn_random_between(d0a0e4c270da0eca).(sub, sub);
1416 break;
1417 }
1418
1419 for(; rnd_len > 0; rnd_len--) {
1420 asn_anonymous_set_cxx . . $ asn_anonymous_set_# *list = _A_SET_FROM_VOIDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:65:9`!(st);
1421 void *ptr = 0;
1422 asn_random_fill_result_tcxx . . $ asn_random_fill_result_t# tmpres = elm->typecxx . . $ asn_TYPE_member_s#type.->opcxx . . $ asn_TYPE_descriptor_s#op.->random_fillcxx . . $ asn_TYPE_operation_s#random_fill.(
1423 elm->typecxx . . $ asn_TYPE_member_s#type., &ptr, &elm->encoding_constraintscxx . . $ asn_TYPE_member_s#encoding_constraints.,
1424 (max_length > res_ok.lengthcxx . . $ asn_random_fill_result_s#length. ? max_length - res_ok.lengthcxx . . $ asn_random_fill_result_s#length. : 0)
1425 / rnd_len);
1426 switch(tmpres.codecxx . . $ asn_random_fill_result_s#code.) {
1427 case ARFILL_OKcxx . . $ asn_random_fill_result_s#ARFILL_OK.:
1428 ASN_SET_ADDcxx . . $ `lib/s1ap/asn1c/asn_SET_OF.h:30:9`!(list, ptr);
1429 res_ok.lengthcxx . . $ asn_random_fill_result_s#length. += tmpres.lengthcxx . . $ asn_random_fill_result_s#length.;
1430 break;
1431 case ARFILL_SKIPPEDcxx . . $ asn_random_fill_result_s#ARFILL_SKIPPED.:
1432 break;
1433 case ARFILL_FAILEDcxx . . $ asn_random_fill_result_s#ARFILL_FAILED.:
1434 assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(ptr == 0);
1435 return tmpres;
1436 }
1437 }
1438
1439 return res_ok;
1440 }
1441