Updated INFO.yaml file
[ric-app/kpimon.git] / asn1c_defs / all-defs / ber_decoder.h
1 /*-\r
2  * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.\r
3  * Redistribution and modifications are permitted subject to BSD license.\r
4  */\r
5 #ifndef _BER_DECODER_H_\r
6 #define _BER_DECODER_H_\r
7 \r
8 #include <asn_application.h>\r
9 \r
10 #ifdef __cplusplus\r
11 extern "C" {\r
12 #endif\r
13 \r
14 struct asn_TYPE_descriptor_s;   /* Forward declaration */\r
15 struct asn_codec_ctx_s;         /* Forward declaration */\r
16 \r
17 /*\r
18  * The BER decoder of any type.\r
19  * This function may be invoked directly from the application.\r
20  * Decodes BER, DER and CER data (DER and CER are different subsets of BER).\r
21  *\r
22  * NOTE: Use the der_encode() function (der_encoder.h) to produce encoding\r
23  * which is compliant with ber_decode().\r
24  */\r
25 asn_dec_rval_t ber_decode(\r
26     const struct asn_codec_ctx_s *opt_codec_ctx,\r
27     const struct asn_TYPE_descriptor_s *type_descriptor,\r
28     void **struct_ptr,  /* Pointer to a target structure's pointer */\r
29     const void *buffer, /* Data to be decoded */\r
30     size_t size         /* Size of that buffer */\r
31 );\r
32 \r
33 /*\r
34  * Type of generic function which decodes the byte stream into the structure.\r
35  */\r
36 typedef asn_dec_rval_t(ber_type_decoder_f)(\r
37     const struct asn_codec_ctx_s *opt_codec_ctx,\r
38     const struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr,\r
39     const void *buf_ptr, size_t size, int tag_mode);\r
40 \r
41 /*******************************\r
42  * INTERNALLY USEFUL FUNCTIONS *\r
43  *******************************/\r
44 \r
45 /*\r
46  * Check that all tags correspond to the type definition (as given in head).\r
47  * On return, last_length would contain either a non-negative length of the\r
48  * value part of the last TLV, or the negative number of expected\r
49  * "end of content" sequences. The number may only be negative if the\r
50  * head->last_tag_form is non-zero.\r
51  */\r
52 asn_dec_rval_t ber_check_tags(\r
53     const struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */\r
54     const struct asn_TYPE_descriptor_s *type_descriptor,\r
55     asn_struct_ctx_t *opt_ctx, /* saved decoding context */\r
56     const void *ptr, size_t size,\r
57     int tag_mode,      /* {-1,0,1}: IMPLICIT, no, EXPLICIT */\r
58     int last_tag_form, /* {-1,0:1}: any, primitive, constr */\r
59     ber_tlv_len_t *last_length, int *opt_tlv_form /* optional tag form */\r
60 );\r
61 \r
62 #ifdef __cplusplus\r
63 }\r
64 #endif\r
65 \r
66 #endif  /* _BER_DECODER_H_ */\r