blob: 69ee10697c5fafd53cf58483675b567d4b7f8b5b [file] [log] [blame]
vlmc4436cf2004-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/*
20 * Specific function to decode simple primitive values
21 * (INTEGER, ENUMERATED, REAL, OBJECT IDENTIFIER, etc).
22 * Also see xer_decode_general() in xer_decoder.h
23 */
24asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
25 asn_TYPE_descriptor_t *type_descriptor,
26 ASN__PRIMITIVE_TYPE_t **struct_ptr,
27 const char *opt_mname,
28 void *buf_ptr, size_t size,
29 ssize_t (*prim_body_decode)(ASN__PRIMITIVE_TYPE_t *struct_ptr,
30 void *chunk_buf, size_t chunk_size)
31 );
32
33#endif /* ASN_CODECS_PRIM_H */