Updated INFO.yaml file
[ric-app/kpimon.git] / asn1c_defs / all-defs / ber_tlv_length.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_TLV_LENGTH_H_\r
6 #define _BER_TLV_LENGTH_H_\r
7 \r
8 #ifdef __cplusplus\r
9 extern "C" {\r
10 #endif\r
11 \r
12 typedef ssize_t ber_tlv_len_t;\r
13 \r
14 /*\r
15  * This function tries to fetch the length of the BER TLV value and place it\r
16  * in *len_r.\r
17  * RETURN VALUES:\r
18  *       0:     More data expected than bufptr contains.\r
19  *      -1:     Fatal error deciphering length.\r
20  *      >0:     Number of bytes used from bufptr.\r
21  * On return with >0, len_r is constrained as -1..MAX, where -1 mean\r
22  * that the value is of indefinite length.\r
23  */\r
24 ssize_t ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,\r
25         ber_tlv_len_t *len_r);\r
26 \r
27 /*\r
28  * This function expects bufptr to be positioned over L in TLV.\r
29  * It returns number of bytes occupied by L and V together, suitable\r
30  * for skipping. The function properly handles indefinite length.\r
31  * RETURN VALUES:\r
32  *      Standard {-1,0,>0} convention.\r
33  */\r
34 ssize_t ber_skip_length(\r
35         const struct asn_codec_ctx_s *opt_codec_ctx,    /* optional context */\r
36         int _is_constructed, const void *bufptr, size_t size);\r
37 \r
38 /*\r
39  * This function serializes the length (L from TLV) in DER format.\r
40  * It always returns number of bytes necessary to represent the length,\r
41  * it is a caller's responsibility to check the return value\r
42  * against the supplied buffer's size.\r
43  */\r
44 size_t der_tlv_length_serialize(ber_tlv_len_t len, void *bufptr, size_t size);\r
45 \r
46 #ifdef __cplusplus\r
47 }\r
48 #endif\r
49 \r
50 #endif  /* _BER_TLV_LENGTH_H_ */\r