vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1 | /*- |
| 2 | * Copyright (c) 2005 Lev Walkin <vlm@lionet.info>. All rights reserved. |
| 3 | * Redistribution and modifications are permitted subject to BSD license. |
| 4 | */ |
| 5 | #ifndef _PER_DECODER_H_ |
| 6 | #define _PER_DECODER_H_ |
| 7 | |
| 8 | #include <asn_application.h> |
| 9 | #include <per_support.h> |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
vlm | 4d2ca12 | 2005-12-07 05:46:03 +0000 | [diff] [blame] | 15 | struct asn_TYPE_descriptor_s; /* Forward declaration */ |
| 16 | |
| 17 | /* |
| 18 | * Unaligned PER decoder of any ASN.1 type. May be invoked by the application. |
| 19 | */ |
| 20 | asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, |
| 21 | struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ |
| 22 | void **struct_ptr, /* Pointer to a target structure's pointer */ |
| 23 | const void *buffer, /* Data to be decoded */ |
vlm | e7e9bd9 | 2006-09-17 11:02:53 +0000 | [diff] [blame] | 24 | size_t size, /* Size of data buffer */ |
vlm | 619448e | 2006-09-18 20:05:55 +0000 | [diff] [blame] | 25 | int skip_bits, /* Number of unused leading bits, 0..7 */ |
| 26 | int unused_bits /* Number of unused tailing bits, 0..7 */ |
vlm | 4d2ca12 | 2005-12-07 05:46:03 +0000 | [diff] [blame] | 27 | ); |
| 28 | |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 29 | |
| 30 | /* |
vlm | 337167e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 31 | * Type of the type-specific PER decoder function. |
| 32 | */ |
| 33 | typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx, |
| 34 | struct asn_TYPE_descriptor_s *type_descriptor, |
| 35 | asn_per_constraints_t *constraints, |
| 36 | void **struct_ptr, |
| 37 | asn_per_data_t *per_data |
| 38 | ); |
| 39 | |
| 40 | #ifdef __cplusplus |
| 41 | } |
| 42 | #endif |
| 43 | |
| 44 | #endif /* _PER_DECODER_H_ */ |