blob: 6303b3cf6d2e8f369d9b1cd8672b7077968639e5 [file] [log] [blame]
vlm337167e2005-11-26 11:25:14 +00001/*-
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
12extern "C" {
13#endif
14
15
16/*
17 * Pre-computed PER constraints.
18 */
19 enum asn_per_constraint_flags {
20 APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
21 APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
22 APC_CONSTRAINED = 0x2, /* Fully constrained */
23 APC_EXTENSIBLE = 0x4 /* May have extension */
24 };
25typedef struct asn_per_constraint_s {
26
27 enum asn_per_constraint_flags flags;
28 int range_bits; /* Full number of bits in the range */
29 int effective_bits; /* Effective bits */
30 long lower_bound; /* "lb" value */
31 long upper_bound; /* "ub" value */
32} asn_per_constraint_t;
33typedef struct asn_per_constraints_s {
34 asn_per_constraint_t value;
35 asn_per_constraint_t size;
36} asn_per_constraints_t;
37
38
39struct asn_TYPE_descriptor_s; /* Forward declaration */
40
41/*
42 * Type of the type-specific PER decoder function.
43 */
44typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
45 struct asn_TYPE_descriptor_s *type_descriptor,
46 asn_per_constraints_t *constraints,
47 void **struct_ptr,
48 asn_per_data_t *per_data
49 );
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif /* _PER_DECODER_H_ */