2 * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
5 #ifndef _APER_SUPPORT_H_
6 #define _APER_SUPPORT_H_
8 #include <asn_system.h> /* Platform-specific types */
9 #include <per_support.h>
16 * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
17 * Get the length "n" from the Aligned PER stream.
19 ssize_t aper_get_length(asn_per_data_t *pd, ssize_t lb, ssize_t ub,
20 int effective_bound_bits, int *repeat);
23 * Get the normally small length "n".
25 ssize_t aper_get_nslength(asn_per_data_t *pd);
28 * Get the normally small non-negative whole number.
30 ssize_t aper_get_nsnnwn(asn_per_data_t *pd, int range);
33 * X.691 (08/2015) #11.9 "General rules for encoding a length determinant"
34 * Put the length "n" to the Aligned PER stream.
35 * If (opt_need_eom) is given, it will be set to 1 if final 0-n is needed.
36 * In that case, invoke aper_put_length(po, -1, -1, 0, NULL) after encoding the
38 * This function returns the number of units which may be flushed
39 * in the next units saving iteration.
41 ssize_t aper_put_length(asn_per_outp_t *po, ssize_t lb, ssize_t ub, size_t n,
44 /* Align the current bit position to octet bundary */
45 int aper_put_align(asn_per_outp_t *po);
46 int32_t aper_get_align(asn_per_data_t *pd);
49 * Put the normally small length "n" to the Unaligned PER stream.
52 int aper_put_nslength(asn_per_outp_t *po, size_t length);
55 * Put the normally small non-negative whole number.
57 int aper_put_nsnnwn(asn_per_outp_t *po, int range, int number);
63 #endif /* _APER_SUPPORT_H_ */