blob: 7a6723d37efc9d7b84db4743b081f2c43a6f18b1 [file] [log] [blame]
Lev Walkin4fd73182004-10-21 11:20:50 +00001/*-
2 * Copyright (c) 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
4 */
5#ifndef ASN_CODECS_PRIM_H
6#define ASN_CODECS_PRIM_H
7
8#include <asn_application.h>
9
10typedef struct ASN__PRIMITIVE_TYPE_s {
11 uint8_t *buf; /* Buffer with consecutive primitive encoding bytes */
12 int size; /* Size of the buffer */
13} ASN__PRIMITIVE_TYPE_t; /* Do not use this type directly! */
14
15asn_struct_free_f ASN__PRIMITIVE_TYPE_free;
16ber_type_decoder_f ber_decode_primitive;
17der_type_encoder_f der_encode_primitive;
18
19/*
Lev Walkin8471cec2004-10-21 14:02:19 +000020 * Specific function to decode simple primitive types.
Lev Walkin4fd73182004-10-21 11:20:50 +000021 * Also see xer_decode_general() in xer_decoder.h
22 */
23asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
24 asn_TYPE_descriptor_t *type_descriptor,
Lev Walkin8471cec2004-10-21 14:02:19 +000025 void **struct_ptr, size_t struct_size,
Lev Walkin4fd73182004-10-21 11:20:50 +000026 const char *opt_mname,
27 void *buf_ptr, size_t size,
Lev Walkine0b56e02005-02-25 12:10:27 +000028 ssize_t (*prim_body_decode)(asn_TYPE_descriptor_t *td,
29 void *struct_ptr, void *chunk_buf, size_t chunk_size)
Lev Walkin4fd73182004-10-21 11:20:50 +000030 );
31
32#endif /* ASN_CODECS_PRIM_H */