blob: ee30f85328f9917d8f626778a4deb7e316af38a4 [file] [log] [blame]
Lev Walkincc159472017-07-06 08:26:36 -07001/*
2 * Copyright (c) 2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
4 */
5#ifndef _OER_ENCODER_H_
6#define _OER_ENCODER_H_
7
8#include <asn_application.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14struct asn_TYPE_descriptor_s; /* Forward declaration */
15
16/*
17 * The Octet Encoding Rules (OER, X.696 08/2015) encoder for any type.
18 * This function may be invoked directly by the application.
19 */
20asn_enc_rval_t oer_encode(struct asn_TYPE_descriptor_s *type_descriptor,
21 void *struct_ptr, /* Structure to be encoded */
22 asn_app_consume_bytes_f *consume_bytes_cb,
23 void *app_key /* Arbitrary callback argument */
24 );
25
26/* A variant of oer_encode() which encodes data into the pre-allocated buffer */
27asn_enc_rval_t oer_encode_to_buffer(
28 struct asn_TYPE_descriptor_s *type_descriptor,
29 void *struct_ptr, /* Structure to be encoded */
30 void *buffer, /* Pre-allocated buffer */
31 size_t buffer_size /* Initial buffer size (maximum) */
32 );
33
34/*
35 * Type of the generic OER encoder.
36 */
37typedef asn_enc_rval_t (oer_type_encoder_f)(
38 struct asn_TYPE_descriptor_s *type_descriptor,
39 void *struct_ptr, /* Structure to be encoded */
40 asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */
41 void *app_key /* Arbitrary callback argument */
42 );
43
44
45#ifdef __cplusplus
46}
47#endif
48
49#endif /* _OER_ENCODER_H_ */