asn_application.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
3  * Redistribution and modifications are permitted subject to BSD license.
4  */
7 #include <errno.h>
8 
9 static asn_enc_rval_t asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx,
10  enum asn_transfer_syntax syntax,
11  const asn_TYPE_descriptor_t *td,
12  const void *sptr,
13  asn_app_consume_bytes_f *callback,
14  void *callback_key);
15 
16 
19  void *callback_key;
20  size_t computed_size;
21 };
22 
23 /*
24  * Encoder which just counts bytes that come through it.
25  */
26 static int
27 callback_count_bytes_cb(const void *data, size_t size, void *keyp) {
28  struct callback_count_bytes_key *key = keyp;
29  int ret;
30 
31  ret = key->callback(data, size, key->callback_key);
32  if(ret >= 0) {
33  key->computed_size += size;
34  }
35 
36  return ret;
37 }
38 
40  void *buffer;
41  size_t buffer_size;
42  size_t computed_size;
43 };
44 
46  void *buffer;
47  size_t buffer_size;
48  size_t computed_size;
49 };
50 
53  void *callback_key;
55 };
56 
57 /*
58  * Encoder which doesn't stop counting bytes
59  * even if it reaches the end of the buffer.
60  */
61 static int
62 overrun_encoder_cb(const void *data, size_t size, void *keyp) {
63  struct overrun_encoder_key *key = keyp;
64 
65  if(key->computed_size + size > key->buffer_size) {
66  /*
67  * Avoid accident on the next call:
68  * stop adding bytes to the buffer.
69  */
70  key->buffer_size = 0;
71  } else {
72  memcpy((char *)key->buffer + key->computed_size, data, size);
73  }
74  key->computed_size += size;
75 
76  return 0;
77 }
78 
79 /*
80  * Encoder which dynamically allocates output, and continues
81  * to count even if allocation failed.
82  */
83 static int
84 dynamic_encoder_cb(const void *data, size_t size, void *keyp) {
85  struct dynamic_encoder_key *key = keyp;
86 
87  if(key->buffer) {
88  if(key->computed_size + size >= key->buffer_size) {
89  void *p;
90  size_t new_size = key->buffer_size;
91 
92  do {
93  new_size *= 2;
94  } while(new_size <= key->computed_size + size);
95 
96  p = REALLOC(key->buffer, new_size);
97  if(p) {
98  key->buffer = p;
99  key->buffer_size = new_size;
100  } else {
101  FREEMEM(key->buffer);
102  key->buffer = 0;
103  key->buffer_size = 0;
104  key->computed_size += size;
105  return 0;
106  }
107  }
108  memcpy((char *)key->buffer + key->computed_size, data, size);
109  }
110 
111  key->computed_size += size;
112 
113  return 0;
114 }
115 
116 /*
117  * Encoder which help convert the application level encoder failure into EIO.
118  */
119 static int
120 callback_failure_catch_cb(const void *data, size_t size, void *keyp) {
121  struct callback_failure_catch_key *key = keyp;
122  int ret;
123 
124  ret = key->callback(data, size, key->callback_key);
125  if(ret < 0) {
126  key->callback_failed = 1;
127  }
128 
129  return ret;
130 }
131 
133 asn_encode(const asn_codec_ctx_t *opt_codec_ctx,
134  enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td,
135  const void *sptr, asn_app_consume_bytes_f *callback, void *callback_key) {
136  struct callback_failure_catch_key cb_key;
137  asn_enc_rval_t er = {0,0,0};
138 
139  if(!callback) {
140  errno = EINVAL;
142  }
143 
144  cb_key.callback = callback;
145  cb_key.callback_key = callback_key;
146  cb_key.callback_failed = 0;
147 
148  er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
149  callback_failure_catch_cb, &cb_key);
150  if(cb_key.callback_failed) {
151  assert(er.encoded == -1);
152  assert(errno == EBADF);
153  errno = EIO;
154  }
155 
156  return er;
157 }
158 
161  enum asn_transfer_syntax syntax,
162  const asn_TYPE_descriptor_t *td, const void *sptr,
163  void *buffer, size_t buffer_size) {
164  struct overrun_encoder_key buf_key;
165  asn_enc_rval_t er = {0,0,0};
166 
167  if(buffer_size > 0 && !buffer) {
168  errno = EINVAL;
170  }
171 
172  buf_key.buffer = buffer;
173  buf_key.buffer_size = buffer_size;
174  buf_key.computed_size = 0;
175 
176  er = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
177  overrun_encoder_cb, &buf_key);
178 
179  if(er.encoded >= 0 && (size_t)er.encoded != buf_key.computed_size) {
180  ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE
181  " yet produced %" ASN_PRI_SIZE " bytes",
182  er.encoded, buf_key.computed_size);
183  assert(er.encoded < 0 || (size_t)er.encoded == buf_key.computed_size);
184  }
185 
186  return er;
187 }
188 
191  enum asn_transfer_syntax syntax,
192  const asn_TYPE_descriptor_t *td, const void *sptr) {
193  struct dynamic_encoder_key buf_key;
195 
196  buf_key.buffer_size = 16;
197  buf_key.buffer = MALLOC(buf_key.buffer_size);
198  buf_key.computed_size = 0;
199 
200  res.result = asn_encode_internal(opt_codec_ctx, syntax, td, sptr,
201  dynamic_encoder_cb, &buf_key);
202 
203  if(res.result.encoded >= 0
204  && (size_t)res.result.encoded != buf_key.computed_size) {
205  ASN_DEBUG("asn_encode() returned %" ASN_PRI_SSIZE
206  " yet produced %" ASN_PRI_SIZE " bytes",
207  res.result.encoded, buf_key.computed_size);
208  assert(res.result.encoded < 0
209  || (size_t)res.result.encoded == buf_key.computed_size);
210  }
211 
212  res.buffer = buf_key.buffer;
213 
214  /* 0-terminate just in case. */
215  if(res.buffer) {
216  assert(buf_key.computed_size < buf_key.buffer_size);
217  ((char *)res.buffer)[buf_key.computed_size] = '\0';
218  }
219 
220  return res;
221 }
222 
223 static asn_enc_rval_t
225  enum asn_transfer_syntax syntax,
226  const asn_TYPE_descriptor_t *td, const void *sptr,
227  asn_app_consume_bytes_f *callback, void *callback_key) {
228  asn_enc_rval_t er = {0,0,0};
229 #if !defined(ASN_DISABLE_XER_SUPPORT)
230  enum xer_encoder_flags_e xer_flags = XER_F_CANONICAL;
231 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
232 #if !defined(ASN_DISABLE_JER_SUPPORT)
233  enum jer_encoder_flags_e jer_flags = JER_F;
234 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
235 
236  (void)opt_codec_ctx; /* Parameters are not checked on encode yet. */
237 
238  if(!td || !sptr) {
239  errno = EINVAL;
241  }
242 
243  switch(syntax) {
245  if(td->op->print_struct) {
246  struct callback_count_bytes_key cb_key;
247  cb_key.callback = callback;
248  cb_key.callback_key = callback_key;
249  cb_key.computed_size = 0;
250  if(td->op->print_struct(td, sptr, 1, callback_count_bytes_cb,
251  &cb_key)
252  < 0
253  || callback_count_bytes_cb("\n", 1, &cb_key) < 0) {
254  errno = EBADF; /* Structure has incorrect form. */
255  er.encoded = -1;
256  er.failed_type = td;
257  er.structure_ptr = sptr;
258  } else {
259  er.encoded = cb_key.computed_size;
260  er.failed_type = 0;
261  er.structure_ptr = 0;
262  }
263  } else {
264  errno = ENOENT; /* Transfer syntax is not defined for this type. */
266  }
267  break;
268 
269  case ATS_RANDOM:
270  errno = ENOENT; /* Randomization doesn't make sense on output. */
272 
273 #if !defined(ASN_DISABLE_BER_SUPPORT)
274  case ATS_BER:
275  /* BER is a superset of DER. */
276  /* Fall through. */
277  case ATS_DER:
278  if(td->op->der_encoder) {
279  er = der_encode(td, sptr, callback, callback_key);
280  if(er.encoded == -1) {
281  if(er.failed_type && er.failed_type->op->der_encoder) {
282  errno = EBADF; /* Structure has incorrect form. */
283  } else {
284  errno = ENOENT; /* DER is not defined for this type. */
285  }
286  }
287  } else {
288  errno = ENOENT; /* Transfer syntax is not defined for this type. */
290  }
291  break;
292  case ATS_CER:
293  errno = ENOENT; /* Transfer syntax is not defined for any type. */
295 #else
296  case ATS_BER:
297  case ATS_DER:
298  case ATS_CER:
299  errno = ENOENT; /* BER is not defined. */
301 
302 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
303 
304 #if !defined(ASN_DISABLE_OER_SUPPORT)
305  case ATS_BASIC_OER:
306  /* CANONICAL-OER is a superset of BASIC-OER. */
307  /* Fall through. */
308  case ATS_CANONICAL_OER:
309  if(td->op->oer_encoder) {
310  er = oer_encode(td, sptr, callback, callback_key);
311  if(er.encoded == -1) {
312  if(er.failed_type && er.failed_type->op->oer_encoder) {
313  errno = EBADF; /* Structure has incorrect form. */
314  } else {
315  errno = ENOENT; /* OER is not defined for this type. */
316  }
317  }
318  } else {
319  errno = ENOENT; /* Transfer syntax is not defined for this type. */
321  }
322  break;
323 #else
324  case ATS_BASIC_OER:
325  case ATS_CANONICAL_OER:
326  errno = ENOENT; /* OER is not defined. */
328  break;
329 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
330 
331 #if !defined(ASN_DISABLE_UPER_SUPPORT)
333  /* CANONICAL-UPER is a superset of BASIC-UPER. */
334  /* Fall through. */
336  if(td->op->uper_encoder) {
337  er = uper_encode(td, 0, sptr, callback, callback_key);
338  if(er.encoded == -1) {
339  if(er.failed_type && er.failed_type->op->uper_encoder) {
340  errno = EBADF; /* Structure has incorrect form. */
341  } else {
342  errno = ENOENT; /* UPER is not defined for this type. */
343  }
344  } else {
345  ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
346  if(er.encoded == 0) {
347  /* Enforce "Complete Encoding" of X.691 #11.1 */
348  if(callback("\0", 1, callback_key) < 0) {
349  errno = EBADF;
351  }
352  er.encoded = 8; /* Exactly 8 zero bits is added. */
353  }
354  /* Convert bits into bytes */
355  er.encoded = (er.encoded + 7) >> 3;
356  }
357  } else {
358  errno = ENOENT; /* Transfer syntax is not defined for this type. */
360  }
361  break;
362 #else
365  errno = ENOENT; /* UPER is not defined. */
367  break;
368 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
369 #if !defined(ASN_DISABLE_APER_SUPPORT)
371  /* CANONICAL-APER is a superset of BASIC-APER. */
372  /* Fall through. */
374  if(td->op->aper_encoder) {
375  er = aper_encode(td, 0, sptr, callback, callback_key);
376  if(er.encoded == -1) {
377  if(er.failed_type && er.failed_type->op->aper_encoder) {
378  errno = EBADF; /* Structure has incorrect form. */
379  } else {
380  errno = ENOENT; /* APER is not defined for this type. */
381  }
382  } else {
383  ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
384  if(er.encoded == 0) {
385  /* Enforce "Complete Encoding" of X.691 #11.1 */
386  if(callback("\0", 1, callback_key) < 0) {
387  errno = EBADF;
389  }
390  er.encoded = 8; /* Exactly 8 zero bits is added. */
391  }
392  /* Convert bits into bytes */
393  er.encoded = (er.encoded + 7) >> 3;
394  }
395  } else {
396  errno = ENOENT; /* Transfer syntax is not defined for this type. */
398  }
399  break;
400 #else
403  errno = ENOENT; /* APER is not defined. */
405  break;
406 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
407 
408 #if !defined(ASN_DISABLE_XER_SUPPORT)
409  case ATS_BASIC_XER:
410  /* CANONICAL-XER is a superset of BASIC-XER. */
411  xer_flags &= ~XER_F_CANONICAL;
412  xer_flags |= XER_F_BASIC;
413  /* Fall through. */
414  case ATS_CANONICAL_XER:
415  if(td->op->xer_encoder) {
416  er = xer_encode(td, sptr, xer_flags, callback, callback_key);
417  if(er.encoded == -1) {
418  if(er.failed_type && er.failed_type->op->xer_encoder) {
419  errno = EBADF; /* Structure has incorrect form. */
420  } else {
421  errno = ENOENT; /* XER is not defined for this type. */
422  }
423  }
424  } else {
425  errno = ENOENT; /* Transfer syntax is not defined for this type. */
427  }
428  break;
429 #else
430  case ATS_BASIC_XER:
431  case ATS_CANONICAL_XER:
432  errno = ENOENT; /* XER is not defined. */
434  break;
435 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
436 
437 #if !defined(ASN_DISABLE_JER_SUPPORT)
438  case ATS_JER_MINIFIED:
439  /* Currently JER_F and JER_F_MINIFIED have opposite purposes
440  * so we just flip the flag. */
441  jer_flags &= ~JER_F;
442  jer_flags |= JER_F_MINIFIED;
443  /* Fall through. */
444  case ATS_JER:
445  if(td->op->jer_encoder) {
446  er = jer_encode(td, sptr, jer_flags, callback, callback_key);
447  if(er.encoded == -1) {
448  if(er.failed_type && er.failed_type->op->jer_encoder) {
449  errno = EBADF; /* Structure has incorrect form. */
450  } else {
451  errno = ENOENT; /* JER is not defined for this type. */
452  }
453  }
454  } else {
455  errno = ENOENT; /* Transfer syntax is not defined for this type. */
457  }
458  break;
459 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
460  default:
461  errno = ENOENT;
463  }
464 
465  return er;
466 }
467 
469 asn_decode(const asn_codec_ctx_t *opt_codec_ctx,
470  enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td,
471  void **sptr, const void *buffer, size_t size) {
472  if(!td || !td->op || !sptr || (size && !buffer)) {
474  }
475 
476  switch(syntax) {
477  case ATS_CER:
479  default:
480  errno = ENOENT;
482 
483  case ATS_RANDOM:
484 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
485  if(!td->op->random_fill) {
487  } else {
488  if(asn_random_fill(td, sptr, 16000) == 0) {
489  asn_dec_rval_t ret = {RC_OK, 0};
490  return ret;
491  } else {
493  }
494  }
495  break;
496 #else
497  errno = ENOENT;
499 #endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
500 
501  case ATS_DER:
502  case ATS_BER:
503 #if !defined(ASN_DISABLE_BER_SUPPORT)
504  return ber_decode(opt_codec_ctx, td, sptr, buffer, size);
505 #else
506  errno = ENOENT;
508 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
509 
510  case ATS_BASIC_OER:
511  case ATS_CANONICAL_OER:
512 #if !defined(ASN_DISABLE_OER_SUPPORT)
513  return oer_decode(opt_codec_ctx, td, sptr, buffer, size);
514 #else
515  errno = ENOENT;
517 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
518 
521 #if !defined(ASN_DISABLE_UPER_SUPPORT)
522  return uper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
523 #else
524  errno = ENOENT;
526 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
527 
530 #if !defined(ASN_DISABLE_APER_SUPPORT)
531  return aper_decode_complete(opt_codec_ctx, td, sptr, buffer, size);
532 #else
533  errno = ENOENT;
535 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
536 
537  case ATS_BASIC_XER:
538  case ATS_CANONICAL_XER:
539 #if !defined(ASN_DISABLE_XER_SUPPORT)
540  return xer_decode(opt_codec_ctx, td, sptr, buffer, size);
541 #else
542  errno = ENOENT;
544 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
545 
546  case ATS_JER:
547  case ATS_JER_MINIFIED:
548 #if !defined(ASN_DISABLE_JER_SUPPORT)
549  return jer_decode(opt_codec_ctx, td, sptr, buffer, size);
550 #else
551  errno = ENOENT;
553 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
554  }
555 }
556 
asn_encode_to_buffer
asn_enc_rval_t asn_encode_to_buffer(const asn_codec_ctx_t *opt_codec_ctx, enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, const void *sptr, void *buffer, size_t buffer_size)
Definition: asn_application.c:160
overrun_encoder_key::buffer
void * buffer
Definition: asn_application.c:40
overrun_encoder_cb
static int overrun_encoder_cb(const void *data, size_t size, void *keyp)
Definition: asn_application.c:62
callback_failure_catch_key
Definition: asn_application.c:51
ATS_BASIC_XER
@ ATS_BASIC_XER
Definition: asn_application.h:62
uper_decode_complete
asn_dec_rval_t uper_decode_complete(const struct asn_codec_ctx_s *opt_codec_ctx, const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, const void *buffer, size_t size)
aper_encode
asn_enc_rval_t aper_encode(const struct asn_TYPE_descriptor_s *type_descriptor, const asn_per_constraints_t *constraints, const void *struct_ptr, asn_app_consume_bytes_f *consume_bytes_cb, void *app_key)
asn_TYPE_operation_s::aper_encoder
per_type_encoder_f * aper_encoder
Definition: constr_TYPE.h:200
overrun_encoder_key::buffer_size
size_t buffer_size
Definition: asn_application.c:41
dynamic_encoder_key
Definition: asn_application.c:45
dynamic_encoder_key::buffer
void * buffer
Definition: asn_application.c:46
asn_enc_rval_s
Definition: asn_codecs.h:41
jer_encoder_flags_e
jer_encoder_flags_e
Definition: jer_encoder.h:20
dynamic_encoder_key::computed_size
size_t computed_size
Definition: asn_application.c:48
callback_failure_catch_key::callback
asn_app_consume_bytes_f * callback
Definition: asn_application.c:52
JER_F
@ JER_F
Definition: jer_encoder.h:22
callback_failure_catch_cb
static int callback_failure_catch_cb(const void *data, size_t size, void *keyp)
Definition: asn_application.c:120
JER_F_MINIFIED
@ JER_F_MINIFIED
Definition: jer_encoder.h:23
asn_TYPE_operation_s::der_encoder
der_type_encoder_f * der_encoder
Definition: constr_TYPE.h:190
ATS_ALIGNED_BASIC_PER
@ ATS_ALIGNED_BASIC_PER
Definition: asn_application.h:55
asn_transfer_syntax
asn_transfer_syntax
Definition: asn_application.h:23
asn_TYPE_operation_s::jer_encoder
jer_type_encoder_f * jer_encoder
Definition: constr_TYPE.h:194
ATS_DER
@ ATS_DER
Definition: asn_application.h:38
asn_enc_rval_s::structure_ptr
const void * structure_ptr
Definition: asn_codecs.h:57
aper_decode_complete
asn_dec_rval_t aper_decode_complete(const struct asn_codec_ctx_s *opt_codec_ctx, const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, const void *buffer, size_t size)
asn_encode_internal
static asn_enc_rval_t asn_encode_internal(const asn_codec_ctx_t *opt_codec_ctx, enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_consume_bytes_f *callback, void *callback_key)
Definition: asn_application.c:224
REALLOC
#define REALLOC(oldptr, size)
Definition: asn_internal.h:39
FREEMEM
#define FREEMEM(ptr)
Definition: asn_internal.h:40
asn_TYPE_operation_s::xer_encoder
xer_type_encoder_f * xer_encoder
Definition: constr_TYPE.h:192
ATS_RANDOM
@ ATS_RANDOM
Definition: asn_application.h:29
ASN__ENCODE_FAILED
#define ASN__ENCODE_FAILED
Definition: asn_codecs.h:59
asn_TYPE_descriptor_s
Definition: constr_TYPE.h:224
overrun_encoder_key
Definition: asn_application.c:39
callback_failure_catch_key::callback_key
void * callback_key
Definition: asn_application.c:53
asn_enc_rval_s::failed_type
const struct asn_TYPE_descriptor_s * failed_type
Definition: asn_codecs.h:54
asn_encode_to_new_buffer_result_s
Definition: asn_application.h:106
asn_random_fill
int asn_random_fill(const struct asn_TYPE_descriptor_s *td, void **struct_ptr, size_t approx_max_length_limit)
Definition: asn_random_fill.c:12
ATS_NONSTANDARD_PLAINTEXT
@ ATS_NONSTANDARD_PLAINTEXT
Definition: asn_application.h:27
overrun_encoder_key::computed_size
size_t computed_size
Definition: asn_application.c:42
uper_encode
asn_enc_rval_t uper_encode(const struct asn_TYPE_descriptor_s *type_descriptor, const asn_per_constraints_t *constraints, const void *struct_ptr, asn_app_consume_bytes_f *consume_bytes_cb, void *app_key)
asn_TYPE_operation_s::random_fill
asn_random_fill_f * random_fill
Definition: constr_TYPE.h:201
callback_failure_catch_key::callback_failed
int callback_failed
Definition: asn_application.c:54
RC_OK
@ RC_OK
Definition: asn_codecs.h:82
asn_TYPE_descriptor_s::op
asn_TYPE_operation_t * op
Definition: constr_TYPE.h:232
ATS_JER
@ ATS_JER
Definition: asn_application.h:69
ASN_PRI_SIZE
#define ASN_PRI_SIZE
Definition: asn_system.h:172
asn_decode
asn_dec_rval_t asn_decode(const asn_codec_ctx_t *opt_codec_ctx, enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size)
Definition: asn_application.c:469
asn_TYPE_operation_s::print_struct
asn_struct_print_f * print_struct
Definition: constr_TYPE.h:186
MALLOC
#define MALLOC(size)
Definition: asn_internal.h:38
jer_encode
asn_enc_rval_t jer_encode(const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, enum jer_encoder_flags_e jer_flags, asn_app_consume_bytes_f *consume_bytes_cb, void *app_key)
ATS_CER
@ ATS_CER
Definition: asn_application.h:39
asn_encode_to_new_buffer
asn_encode_to_new_buffer_result_t asn_encode_to_new_buffer(const asn_codec_ctx_t *opt_codec_ctx, enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, const void *sptr)
Definition: asn_application.c:190
callback_count_bytes_key::callback_key
void * callback_key
Definition: asn_application.c:19
key
static void ssize_t void * key
Definition: asn_internal.h:96
ASN_PRI_SSIZE
#define ASN_PRI_SSIZE
Definition: asn_system.h:173
asn_app_consume_bytes_f
int() asn_app_consume_bytes_f(const void *buffer, size_t size, void *application_specific_key)
Definition: asn_application.h:124
dynamic_encoder_key::buffer_size
size_t buffer_size
Definition: asn_application.c:47
asn_internal.h
asn_codec_ctx_s
Definition: asn_codecs.h:23
callback_count_bytes_cb
static int callback_count_bytes_cb(const void *data, size_t size, void *keyp)
Definition: asn_application.c:27
asn_dec_rval_s
Definition: asn_codecs.h:86
jer_decode
asn_dec_rval_t jer_decode(const struct asn_codec_ctx_s *opt_codec_ctx, const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, const void *buffer, size_t size)
ASN__DECODE_FAILED
#define ASN__DECODE_FAILED
Definition: asn_codecs.h:90
asn_TYPE_operation_s::uper_encoder
per_type_encoder_f * uper_encoder
Definition: constr_TYPE.h:198
ATS_UNALIGNED_BASIC_PER
@ ATS_UNALIGNED_BASIC_PER
Definition: asn_application.h:53
asn_enc_rval_s::encoded
ssize_t encoded
Definition: asn_codecs.h:47
asn_application.h
ATS_CANONICAL_XER
@ ATS_CANONICAL_XER
Definition: asn_application.h:63
callback_count_bytes_key::computed_size
size_t computed_size
Definition: asn_application.c:20
callback_count_bytes_key
Definition: asn_application.c:17
ATS_ALIGNED_CANONICAL_PER
@ ATS_ALIGNED_CANONICAL_PER
Definition: asn_application.h:56
ATS_CANONICAL_OER
@ ATS_CANONICAL_OER
Definition: asn_application.h:46
asn_encode
asn_enc_rval_t asn_encode(const asn_codec_ctx_t *opt_codec_ctx, enum asn_transfer_syntax syntax, const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_consume_bytes_f *callback, void *callback_key)
Definition: asn_application.c:133
ATS_JER_MINIFIED
@ ATS_JER_MINIFIED
Definition: asn_application.h:70
ATS_BER
@ ATS_BER
Definition: asn_application.h:37
dynamic_encoder_cb
static int dynamic_encoder_cb(const void *data, size_t size, void *keyp)
Definition: asn_application.c:84
asn_TYPE_operation_s::oer_encoder
oer_type_encoder_f * oer_encoder
Definition: constr_TYPE.h:196
callback_count_bytes_key::callback
asn_app_consume_bytes_f * callback
Definition: asn_application.c:18
ATS_UNALIGNED_CANONICAL_PER
@ ATS_UNALIGNED_CANONICAL_PER
Definition: asn_application.h:54
ATS_BASIC_OER
@ ATS_BASIC_OER
Definition: asn_application.h:45


etsi_its_vam_ts_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:30:55