Adding initial code jy.oak@samsung.com
[ric-app/kpimon.git] / asn1c_defs / all-defs / ber_decoder.h
diff --git a/asn1c_defs/all-defs/ber_decoder.h b/asn1c_defs/all-defs/ber_decoder.h
new file mode 100755 (executable)
index 0000000..068084f
--- /dev/null
@@ -0,0 +1,66 @@
+/*-\r
+ * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.\r
+ * Redistribution and modifications are permitted subject to BSD license.\r
+ */\r
+#ifndef        _BER_DECODER_H_\r
+#define        _BER_DECODER_H_\r
+\r
+#include <asn_application.h>\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+struct asn_TYPE_descriptor_s;  /* Forward declaration */\r
+struct asn_codec_ctx_s;                /* Forward declaration */\r
+\r
+/*\r
+ * The BER decoder of any type.\r
+ * This function may be invoked directly from the application.\r
+ * Decodes BER, DER and CER data (DER and CER are different subsets of BER).\r
+ *\r
+ * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding\r
+ * which is compliant with ber_decode().\r
+ */\r
+asn_dec_rval_t ber_decode(\r
+    const struct asn_codec_ctx_s *opt_codec_ctx,\r
+    const struct asn_TYPE_descriptor_s *type_descriptor,\r
+    void **struct_ptr,  /* Pointer to a target structure's pointer */\r
+    const void *buffer, /* Data to be decoded */\r
+    size_t size         /* Size of that buffer */\r
+);\r
+\r
+/*\r
+ * Type of generic function which decodes the byte stream into the structure.\r
+ */\r
+typedef asn_dec_rval_t(ber_type_decoder_f)(\r
+    const struct asn_codec_ctx_s *opt_codec_ctx,\r
+    const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,\r
+    const void *buf_ptr, size_t size, int tag_mode);\r
+\r
+/*******************************\r
+ * INTERNALLY USEFUL FUNCTIONS *\r
+ *******************************/\r
+\r
+/*\r
+ * Check that all tags correspond to the type definition (as given in head).\r
+ * On return, last_length would contain either a non-negative length of the\r
+ * value part of the last TLV, or the negative number of expected\r
+ * "end of content" sequences. The number may only be negative if the\r
+ * head->last_tag_form is non-zero.\r
+ */\r
+asn_dec_rval_t ber_check_tags(\r
+    const struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */\r
+    const struct asn_TYPE_descriptor_s *type_descriptor,\r
+    asn_struct_ctx_t *opt_ctx, /* saved decoding context */\r
+    const void *ptr, size_t size,\r
+    int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */\r
+    int last_tag_form, /* {-1,0:1}: any, primitive, constr */\r
+    ber_tlv_len_t *last_length, int *opt_tlv_form /* optional tag form */\r
+);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* _BER_DECODER_H_ */\r