]> git.stg.codes - stg.git/blobdiff - libs/smux/include/stg/ber_decoder.h
Regen SMUX support library with more recent ASN1 compiler.
[stg.git] / libs / smux / include / stg / ber_decoder.h
index 9fe2e895dfb65375948b83a893629959d5c576b1..1ac2a5ef0d90ea16bf8a3e1d5725fe921a34b3d5 100644 (file)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
  * Redistribution and modifications are permitted subject to BSD license.
  */
 #ifndef        _BER_DECODER_H_
@@ -17,23 +17,26 @@ struct asn_codec_ctx_s;             /* Forward declaration */
 /*
  * The BER decoder of any type.
  * This function may be invoked directly from the application.
- * The der_encode() function (der_encoder.h) is an opposite to ber_decode().
+ * Decodes BER, DER and CER data (DER and CER are different subsets of BER).
+ *
+ * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding
+ * which is compliant with ber_decode().
  */
-asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx,
-       struct asn_TYPE_descriptor_s *type_descriptor,
-       void **struct_ptr,      /* Pointer to a target structure's pointer */
-       const void *buffer,     /* Data to be decoded */
-       size_t size             /* Size of that buffer */
-       );
+asn_dec_rval_t ber_decode(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    void **struct_ptr,  /* Pointer to a target structure's pointer */
+    const void *buffer, /* Data to be decoded */
+    size_t size         /* Size of that buffer */
+);
 
 /*
  * Type of generic function which decodes the byte stream into the structure.
  */
-typedef asn_dec_rval_t (ber_type_decoder_f)(
-               struct asn_codec_ctx_s *opt_codec_ctx,
-               struct asn_TYPE_descriptor_s *type_descriptor,
-               void **struct_ptr, const void *buf_ptr, size_t size,
-               int tag_mode);
+typedef asn_dec_rval_t(ber_type_decoder_f)(
+    const struct asn_codec_ctx_s *opt_codec_ctx,
+    const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,
+    const void *buf_ptr, size_t size, int tag_mode);
 
 /*******************************
  * INTERNALLY USEFUL FUNCTIONS *
@@ -47,15 +50,14 @@ typedef asn_dec_rval_t (ber_type_decoder_f)(
  * head->last_tag_form is non-zero.
  */
 asn_dec_rval_t ber_check_tags(
-               struct asn_codec_ctx_s *opt_codec_ctx,  /* codec options */
-               struct asn_TYPE_descriptor_s *type_descriptor,
-               asn_struct_ctx_t *opt_ctx,      /* saved decoding context */
-               const void *ptr, size_t size,
-               int tag_mode,           /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
-               int last_tag_form,      /* {-1,0:1}: any, primitive, constr */
-               ber_tlv_len_t *last_length,
-               int *opt_tlv_form       /* optional tag form */
-       );
+    const struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */
+    const struct asn_TYPE_descriptor_s *type_descriptor,
+    asn_struct_ctx_t *opt_ctx, /* saved decoding context */
+    const void *ptr, size_t size,
+    int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */
+    int last_tag_form, /* {-1,0:1}: any, primitive, constr */
+    ber_tlv_len_t *last_length, int *opt_tlv_form /* optional tag form */
+);
 
 #ifdef __cplusplus
 }