Debian Codegraph @

lib/s1ap/asn1c/per_support.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2005-2017 Lev Walkin <[email protected]>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
4 */
5 #ifndef _PER_SUPPORT_H_
6 #define _PER_SUPPORT_H_cxx . . $ `lib/s1ap/asn1c/per_support.h:6:9`!
7
8 #include <asn_system.h>cxx . . $ `<file>/lib/s1ap/asn1c/asn_system.h`/ /* Platform-specific types */
9 #include <asn_bit_data.h>cxx . . $ `<file>/lib/s1ap/asn1c/asn_bit_data.h`/
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 /*
16 * Pre-computed PER constraints.
17 */
18 typedef struct asn_per_constraint_scxx . . $ asn_per_constraint_s# {
19 enum asn_per_constraint_flagscxx . . $ asn_per_constraint_flags# {
20 APC_UNCONSTRAINEDcxx . . $ APC_UNCONSTRAINED. = 0x0, /* No PER visible constraints */
21 APC_SEMI_CONSTRAINEDcxx . . $ APC_SEMI_CONSTRAINED. = 0x1, /* Constrained at "lb" */
22 APC_CONSTRAINEDcxx . . $ APC_CONSTRAINED. = 0x2, /* Fully constrained */
23 APC_EXTENSIBLEcxx . . $ APC_EXTENSIBLE. = 0x4 /* May have extension */
24 } flagscxx . . $ asn_per_constraint_s#flags.;
25 int range_bitscxx . . $ asn_per_constraint_s#range_bits.; /* Full number of bits in the range */
26 int effective_bitscxx . . $ asn_per_constraint_s#effective_bits.; /* Effective bits */
27 long lower_boundcxx . . $ asn_per_constraint_s#lower_bound.; /* "lb" value */
28 long upper_boundcxx . . $ asn_per_constraint_s#upper_bound.; /* "ub" value */
29 } asn_per_constraint_tcxx . . $ asn_per_constraint_t#;
30 typedef struct asn_per_constraints_scxx . . $ asn_per_constraints_s# {
31 asn_per_constraint_tcxx . . $ asn_per_constraint_t# valuecxx . . $ asn_per_constraints_s#value.;
32 asn_per_constraint_tcxx . . $ asn_per_constraint_t# sizecxx . . $ asn_per_constraints_s#size.;
33 int (*value2codecxx . . $ asn_per_constraints_s#value2code.)(unsigned int value);
34 int (*code2valuecxx . . $ asn_per_constraints_s#code2value.)(unsigned int code);
35 } asn_per_constraints_tcxx . . $ asn_per_constraints_t#;
36
37 /* Temporary compatibility layer. Will get removed. */
38 typedef struct asn_bit_data_scxx . . $ asn_bit_data_s# asn_per_data_tcxx . . $ asn_per_data_t#;
39 #define per_get_few_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:39:9`!(data, bits) asn_get_few_bits(data, bits)
40 #define per_get_undocxx . . $ `lib/s1ap/asn1c/per_support.h:40:9`!(data, bits) asn_get_undo(data, bits)
41 #define per_get_many_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:41:9`!(data, dst, align, bits) \
42 asn_get_many_bits(data, dst, align, bits)
43
44 /*
45 * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
46 * Get the length "n" from the Unaligned PER stream.
47 */
48 ssize_tcxx . . $ ssize_t# uper_get_lengthcxx . . $ uper_get_length(14d590abbb3d316b).(asn_per_data_tcxx . . $ asn_per_data_t# *pd, int effective_bound_bits,
49 size_t lower_bound, int *repeat);
50
51 ssize_tcxx . . $ ssize_t# aper_get_lengthcxx . . $ aper_get_length(f83e194f1de67789).(asn_per_data_tcxx . . $ asn_per_data_t# *pd, int range,
52 int effective_bound_bits, int *repeat);
53
54 /*
55 * Get the normally small length "n".
56 */
57 ssize_tcxx . . $ ssize_t# uper_get_nslengthcxx . . $ uper_get_nslength(41e3a4e99f2695d).(asn_per_data_tcxx . . $ asn_per_data_t# *pd);
58 ssize_tcxx . . $ ssize_t# aper_get_nslengthcxx . . $ aper_get_nslength(41e3a4e99f2695d).(asn_per_data_tcxx . . $ asn_per_data_t# *pd);
59
60 /*
61 * Get the normally small non-negative whole number.
62 */
63 ssize_tcxx . . $ ssize_t# uper_get_nsnnwncxx . . $ uper_get_nsnnwn(41e3a4e99f2695d).(asn_per_data_tcxx . . $ asn_per_data_t# *pd);
64 ssize_tcxx . . $ ssize_t# aper_get_nsnnwncxx . . $ aper_get_nsnnwn(b5fa03b2df232cb2).(asn_per_data_tcxx . . $ asn_per_data_t# *pd, int range);
65
66 /* X.691-2008/11, #11.5.6 */
67 int uper_get_constrained_whole_numbercxx . . $ uper_get_constrained_whole_number(9d9166b18182ac9a).(asn_per_data_tcxx . . $ asn_per_data_t# *pd, unsigned long *v, int nbits);
68
69
70 /* Temporary compatibility layer. Will get removed. */
71 typedef struct asn_bit_outp_scxx . . $ asn_bit_outp_s# asn_per_outp_tcxx . . $ asn_per_outp_t#;
72 #define per_put_few_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:72:9`!(out, bits, obits) asn_put_few_bits(out, bits, obits)
73 #define per_put_many_bitscxx . . $ `lib/s1ap/asn1c/per_support.h:73:9`!(out, src, nbits) asn_put_many_bits(out, src, nbits)
74 #define per_put_aligned_flushcxx . . $ `lib/s1ap/asn1c/per_support.h:74:9`!(out) asn_put_aligned_flush(out)
75
76
77 /*
78 * Rebase the given value as an offset into the range specified by the
79 * lower bound (lb) and upper bound (ub).
80 * RETURN VALUES:
81 * -1: Conversion failed due to range problems.
82 * 0: Conversion was successful.
83 */
84 int per_long_range_rebasecxx . . $ per_long_range_rebase(3a3bdc2834d4dc8d).(long v, long lb, long ub, unsigned long *output);
85 /* The inverse operation: restores the value by the offset and its bounds. */
86 int per_long_range_unrebasecxx . . $ per_long_range_unrebase(dbcdf073bf790034).(unsigned long inp, long lb, long ub, long *outp);
87
88 /* X.691-2008/11, #11.5 */
89 int uper_put_constrained_whole_number_ucxx . . $ uper_put_constrained_whole_number_u(12a43888f6d4880d).(asn_per_outp_tcxx . . $ asn_per_outp_t# *po, unsigned long v, int nbits);
90
91 /*
92 * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
93 * Put the length "whole_length" to the Unaligned PER stream.
94 * If (opt_need_eom) is given, it will be set to 1 if final 0-length is needed.
95 * In that case, invoke uper_put_length(po, 0, 0) after encoding the last block.
96 * This function returns the number of units which may be flushed
97 * in the next units saving iteration.
98 */
99 ssize_tcxx . . $ ssize_t# uper_put_lengthcxx . . $ uper_put_length(8430978b5e735d38).(asn_per_outp_tcxx . . $ asn_per_outp_t# *po, size_t whole_length,
100 int *opt_need_eom);
101
102 ssize_tcxx . . $ ssize_t# aper_put_lengthcxx . . $ aper_put_length(51d69906b62e57b7).(asn_per_outp_tcxx . . $ asn_per_outp_t# *po, int range, size_t length);
103
104 /* Align the current bit position to octet bundary */
105 int aper_put_aligncxx . . $ aper_put_align(8263f7cdac5e5af7).(asn_per_outp_tcxx . . $ asn_per_outp_t# *po);
106 int32_tcxx . . $ int32_t# aper_get_aligncxx . . $ aper_get_align(4851b8fd0e353f92).(asn_per_data_tcxx . . $ asn_per_data_t# *pd);
107
108 /*
109 * Put the normally small length "n" to the Unaligned PER stream.
110 * Returns 0 or -1.
111 */
112 int uper_put_nslengthcxx . . $ uper_put_nslength(8265282fd2d7d960).(asn_per_outp_tcxx . . $ asn_per_outp_t# *po, size_t length);
113
114 int aper_put_nslengthcxx . . $ aper_put_nslength(8265282fd2d7d960).(asn_per_outp_tcxx . . $ asn_per_outp_t# *po, size_t length);
115
116 /*
117 * Put the normally small non-negative whole number.
118 */
119 int uper_put_nsnnwncxx . . $ uper_put_nsnnwn(8341711b45e0c7e9).(asn_per_outp_tcxx . . $ asn_per_outp_t# *po, int n);
120
121 int aper_put_nsnnwncxx . . $ aper_put_nsnnwn(936b7d6d5be18465).(asn_per_outp_tcxx . . $ asn_per_outp_t# *po, int range, int number);
122
123 #ifdef __cplusplus
124 }
125 #endif
126
127 #endif /* _PER_SUPPORT_H_ */