Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
c46b7cb5
Commit
c46b7cb5
authored
Aug 18, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
5af1a699
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
328 additions
and
1039 deletions
+328
-1039
asn1c/tests/check-22.c
asn1c/tests/check-22.c
+2
-1
asn1c/tests/check-32.c
asn1c/tests/check-32.c
+11
-11
configure
configure
+237
-949
configure.in
configure.in
+0
-3
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+2
-1
libasn1compiler/asn1c_compat.c
libasn1compiler/asn1c_compat.c
+1
-1
libasn1compiler/asn1c_misc.c
libasn1compiler/asn1c_misc.c
+2
-2
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+10
-11
libasn1fix/asn1fix_cws.c
libasn1fix/asn1fix_cws.c
+4
-2
libasn1parser/asn1p_class.c
libasn1parser/asn1p_class.c
+3
-3
libasn1parser/asn1p_class.h
libasn1parser/asn1p_class.h
+1
-1
libasn1parser/asn1p_y.c
libasn1parser/asn1p_y.c
+3
-3
libasn1parser/asn1p_y.h
libasn1parser/asn1p_y.h
+1
-1
libasn1parser/asn1p_y.y
libasn1parser/asn1p_y.y
+3
-3
skeletons/constr_SEQUENCE.c
skeletons/constr_SEQUENCE.c
+4
-2
skeletons/per_decoder.h
skeletons/per_decoder.h
+0
-21
skeletons/per_support.h
skeletons/per_support.h
+44
-24
No files found.
asn1c/tests/check-22.c
View file @
c46b7cb5
...
...
@@ -47,6 +47,7 @@ buf2_fill(const void *buffer, size_t size, void *app_key) {
static
void
check
(
int
is_ok
,
uint8_t
*
buf
,
int
size
,
size_t
consumed
)
{
T1_t
t
,
*
tp
;
void
*
tpp
=
&
tp
;
asn_dec_rval_t
rval
;
asn_enc_rval_t
erval
;
int
ret
;
...
...
@@ -55,7 +56,7 @@ check(int is_ok, uint8_t *buf, int size, size_t consumed) {
tp
=
memset
(
&
t
,
0
,
sizeof
(
t
));
fprintf
(
stderr
,
"Buf %p
\n
"
,
buf
);
rval
=
ber_decode
(
0
,
&
asn_DEF_T1
,
(
void
**
)
&
t
p
,
buf
,
size
);
rval
=
ber_decode
(
0
,
&
asn_DEF_T1
,
(
void
**
)
tp
p
,
buf
,
size
);
fprintf
(
stderr
,
"Returned code %d, consumed %d
\n
"
,
(
int
)
rval
.
code
,
(
int
)
rval
.
consumed
);
...
...
asn1c/tests/check-32.c
View file @
c46b7cb5
...
...
@@ -18,7 +18,6 @@ main(int ac, char **av) {
asn_enc_rval_t
erv
;
asn_dec_rval_t
drv
;
char
buf
[
128
];
size_t
bufsize
=
sizeof
(
buf
);
(
void
)
ac
;
/* Unused argument */
(
void
)
av
;
/* Unused argument */
...
...
@@ -44,35 +43,36 @@ main(int ac, char **av) {
* Encode the sequence.
*/
erv
=
der_encode_to_buffer
(
&
asn_DEF_SeqWithMandatory
,
&
swm
,
buf
,
&
bufsize
);
assert
(
erv
.
encoded
==
bufsize
);
&
swm
,
buf
,
sizeof
buf
);
assert
(
erv
.
encoded
>
0
);
buf
[
erv
.
encoded
]
=
'\0'
;
/*
* Try to decode it using a compatible type.
*/
drv
=
ber_decode
(
0
,
&
asn_DEF_SeqWithOptional
,
(
void
**
)
&
swo
,
buf
,
bufsize
);
buf
,
erv
.
encoded
);
assert
(
drv
.
code
==
RC_OK
);
assert
(
drv
.
consumed
==
bufsize
);
assert
(
drv
.
consumed
==
erv
.
encoded
);
assert
(
swo
->
seqOfOpt
!=
0
);
xer_fprint
(
stderr
,
&
asn_DEF_SeqWithOptional
,
swo
);
swo
->
seqOfOpt
=
0
;
bufsize
=
sizeof
(
buf
);
erv
=
der_encode_to_buffer
(
&
asn_DEF_SeqWithOptional
,
swo
,
buf
,
&
bufsize
);
assert
(
erv
.
encoded
==
bufsize
);
swo
,
buf
,
sizeof
buf
);
assert
(
erv
.
encoded
>
0
);
buf
[
erv
.
encoded
]
=
'\0'
;
swo
=
0
;
drv
=
ber_decode
(
0
,
&
asn_DEF_SeqWithMandatory
,
(
void
**
)
&
swo
,
buf
,
bufsize
);
buf
,
erv
.
encoded
);
assert
(
drv
.
code
!=
RC_OK
);
swo
=
0
;
drv
=
ber_decode
(
0
,
&
asn_DEF_SeqWithOptional
,
(
void
**
)
&
swo
,
buf
,
bufsize
);
buf
,
erv
.
encoded
);
assert
(
drv
.
code
==
RC_OK
);
assert
(
drv
.
consumed
==
bufsize
);
assert
(
drv
.
consumed
==
erv
.
encoded
);
assert
(
swo
->
seqOfOpt
==
0
);
xer_fprint
(
stderr
,
&
asn_DEF_SeqWithOptional
,
swo
);
...
...
configure
View file @
c46b7cb5
This diff is collapsed.
Click to expand it.
configure.in
View file @
c46b7cb5
...
...
@@ -26,9 +26,6 @@ AC_SUBST(CONFIGURE_DEPENDS)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AM_CONDITIONAL(CPLUSPLUS_FOUND, test -n "$ac_ct_CXX")
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
...
...
libasn1compiler/asn1c_C.c
View file @
c46b7cb5
...
...
@@ -1784,7 +1784,8 @@ emit_single_member_PER_constraint(arg_t *arg, asn1cnst_range_t *range, char *typ
asn1c_integer_t
cover
=
1
;
asn1c_integer_t
r
=
1
+
range
->
right
.
value
-
range
->
left
.
value
;
int
rbits
,
ebits
;
size_t
rbits
;
/* Value range bits */
ssize_t
ebits
;
/* Value effective range bits */
if
(
range
->
empty_constraint
)
r
=
0
;
...
...
libasn1compiler/asn1c_compat.c
View file @
c46b7cb5
...
...
@@ -32,7 +32,7 @@ asn1c_open_file(const char *name, const char *ext, char **opt_tmpname) {
fname
=
alloca
(
len
);
ret
=
snprintf
(
fname
,
len
,
"%s%s%s"
,
name
,
ext
,
opt_tmpname
?
".XXXXXX"
:
""
);
assert
(
ret
>
0
&&
ret
<
len
);
assert
(
ret
>
0
&&
ret
<
(
ssize_t
)
len
);
if
(
opt_tmpname
)
{
/*
...
...
libasn1compiler/asn1c_misc.c
View file @
c46b7cb5
...
...
@@ -20,7 +20,7 @@ static char *res_kwd[] = {
};
static
int
reserved_keyword
(
const
char
*
str
)
{
in
t
i
;
size_
t
i
;
for
(
i
=
0
;
i
<
sizeof
(
res_kwd
)
/
sizeof
(
res_kwd
[
0
]);
i
++
)
{
if
(
strcmp
(
str
,
res_kwd
[
i
])
==
0
)
return
1
;
...
...
@@ -42,7 +42,7 @@ asn1c_make_identifier(enum ami_flags_e flags, asn1p_expr_t *expr, ...) {
char
*
nextstr
;
char
*
first
=
0
;
char
*
second
=
0
;
size_t
size
;
s
s
ize_t
size
;
char
*
p
;
if
(
expr
)
{
...
...
libasn1compiler/asn1c_save.c
View file @
c46b7cb5
...
...
@@ -6,13 +6,13 @@
#include "asn1c_save.h"
#include "asn1c_out.h"
static
int
asn1c_dump_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
,
int
,
int
,
char
**
);
static
int
asn1c_dump_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
,
int
,
char
**
);
static
int
asn1c_print_streams
(
arg_t
*
arg
);
static
int
asn1c_save_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
,
int
,
int
,
char
**
);
static
int
asn1c_save_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
,
int
,
char
**
);
static
int
asn1c_copy_over
(
arg_t
*
arg
,
char
*
path
);
static
int
identical_files
(
const
char
*
fname1
,
const
char
*
fname2
);
static
int
generate_pdu_collection_file
(
arg_t
*
arg
);
static
int
generate_preamble
(
arg_t
*
,
FILE
*
,
int
argc
,
int
optc
,
char
**
argv
);
static
int
generate_preamble
(
arg_t
*
,
FILE
*
,
int
optc
,
char
**
argv
);
int
asn1c_save_compiled_output
(
arg_t
*
arg
,
const
char
*
datadir
,
...
...
@@ -33,8 +33,7 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
TQ_FOR
(
arg
->
expr
,
&
(
mod
->
members
),
next
)
{
if
(
asn1_lang_map
[
arg
->
expr
->
meta_type
]
[
arg
->
expr
->
expr_type
].
type_cb
)
{
if
(
asn1c_dump_streams
(
arg
,
deps
,
argc
,
optc
,
argv
))
if
(
asn1c_dump_streams
(
arg
,
deps
,
optc
,
argv
))
return
-
1
;
}
}
...
...
@@ -155,11 +154,11 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
* Dump the streams.
*/
static
int
asn1c_dump_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
deps
,
int
argc
,
int
optc
,
char
**
argv
)
{
asn1c_dump_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
deps
,
int
optc
,
char
**
argv
)
{
if
(
arg
->
flags
&
A1C_PRINT_COMPILED
)
{
return
asn1c_print_streams
(
arg
);
}
else
{
return
asn1c_save_streams
(
arg
,
deps
,
argc
,
optc
,
argv
);
return
asn1c_save_streams
(
arg
,
deps
,
optc
,
argv
);
}
}
...
...
@@ -187,7 +186,7 @@ asn1c_print_streams(arg_t *arg) {
}
static
int
asn1c_save_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
deps
,
int
argc
,
int
optc
,
char
**
argv
)
{
asn1c_save_streams
(
arg_t
*
arg
,
asn1c_fdeps_t
*
deps
,
int
optc
,
char
**
argv
)
{
asn1p_expr_t
*
expr
=
arg
->
expr
;
compiler_streams_t
*
cs
=
expr
->
data
;
out_chunk_t
*
ot
;
...
...
@@ -212,8 +211,8 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps, int argc, int optc, char **a
return
-
1
;
}
generate_preamble
(
arg
,
fp_c
,
argc
,
optc
,
argv
);
generate_preamble
(
arg
,
fp_h
,
argc
,
optc
,
argv
);
generate_preamble
(
arg
,
fp_c
,
optc
,
argv
);
generate_preamble
(
arg
,
fp_h
,
optc
,
argv
);
header_id
=
asn1c_make_identifier
(
0
,
expr
,
NULL
);
fprintf
(
fp_h
,
...
...
@@ -303,7 +302,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps, int argc, int optc, char **a
}
static
int
generate_preamble
(
arg_t
*
arg
,
FILE
*
fp
,
int
argc
,
int
optc
,
char
**
argv
)
{
generate_preamble
(
arg_t
*
arg
,
FILE
*
fp
,
int
optc
,
char
**
argv
)
{
fprintf
(
fp
,
"/*
\n
"
" * Generated by asn1c-"
VERSION
" (http://lionet.info/asn1c)
\n
"
...
...
libasn1fix/asn1fix_cws.c
View file @
c46b7cb5
...
...
@@ -169,6 +169,7 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row, struct asn1p_i
uint8_t
*
buf
,
const
uint8_t
*
bend
)
{
asn1p_expr_t
*
expr
;
asn1p_ref_t
*
ref
;
int
idLength
;
char
*
p
;
if
((
bend
-
buf
)
<=
0
)
{
...
...
@@ -220,8 +221,9 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row, struct asn1p_i
cell
->
value
=
expr
;
if
(
row
->
max_identifier_length
<
strlen
(
expr
->
Identifier
))
row
->
max_identifier_length
=
strlen
(
expr
->
Identifier
);
idLength
=
strlen
(
expr
->
Identifier
);
if
(
row
->
max_identifier_length
<
idLength
)
row
->
max_identifier_length
=
idLength
;
return
0
;
}
...
...
libasn1parser/asn1p_class.c
View file @
c46b7cb5
...
...
@@ -154,19 +154,19 @@ asn1p_wsyntx_clone(asn1p_wsyntx_t *wx) {
}
asn1p_wsyntx_chunk_t
*
asn1p_wsyntx_chunk_from
buf
(
char
*
buf
,
int
l
en
,
int
do_copy
)
{
asn1p_wsyntx_chunk_from
string
(
char
*
tok
en
,
int
do_copy
)
{
asn1p_wsyntx_chunk_t
*
wc
;
if
(
do_copy
)
{
static
asn1p_wsyntx_chunk_t
tmp
;
tmp
.
type
=
WC_LITERAL
;
tmp
.
content
.
token
=
buf
;
tmp
.
content
.
token
=
token
;
wc
=
asn1p_wsyntx_chunk_clone
(
&
tmp
);
}
else
{
wc
=
asn1p_wsyntx_chunk_new
();
if
(
wc
)
{
wc
->
type
=
WC_LITERAL
;
wc
->
content
.
token
=
buf
;
wc
->
content
.
token
=
token
;
}
}
...
...
libasn1parser/asn1p_class.h
View file @
c46b7cb5
...
...
@@ -69,7 +69,7 @@ asn1p_wsyntx_t *asn1p_wsyntx_clone(asn1p_wsyntx_t *);
* 0: Component has been added
* -1: Failure to add component (refer to errno)
*/
asn1p_wsyntx_chunk_t
*
asn1p_wsyntx_chunk_from
buf
(
char
*
buf
,
int
l
en
,
int
_copy
);
asn1p_wsyntx_chunk_t
*
asn1p_wsyntx_chunk_from
string
(
char
*
tok
en
,
int
_copy
);
asn1p_wsyntx_chunk_t
*
asn1p_wsyntx_chunk_fromsyntax
(
asn1p_wsyntx_t
*
syntax
);
...
...
libasn1parser/asn1p_y.c
View file @
c46b7cb5
...
...
@@ -2785,7 +2785,7 @@ yyreduce:
case
109
:
#line 1125 "asn1p_y.y"
{
yyval
.
a_wchunk
=
asn1p_wsyntx_chunk_from
buf
(
yyvsp
[
0
].
tv_opaque
.
buf
,
yyvsp
[
0
].
tv_opaque
.
len
,
0
);
yyval
.
a_wchunk
=
asn1p_wsyntx_chunk_from
string
(
yyvsp
[
0
].
tv_opaque
.
buf
,
0
);
yyval
.
a_wchunk
->
type
=
WC_WHITESPACE
;
}
break
;
...
...
@@ -2793,14 +2793,14 @@ yyreduce:
case
110
:
#line 1129 "asn1p_y.y"
{
yyval
.
a_wchunk
=
asn1p_wsyntx_chunk_from
buf
(
yyvsp
[
0
].
tv_str
,
strlen
(
yyvsp
[
0
].
tv_str
)
,
0
);
yyval
.
a_wchunk
=
asn1p_wsyntx_chunk_from
string
(
yyvsp
[
0
].
tv_str
,
0
);
}
break
;
case
111
:
#line 1132 "asn1p_y.y"
{
yyval
.
a_wchunk
=
asn1p_wsyntx_chunk_from
buf
(
yyvsp
[
0
].
a_refcomp
.
name
,
strlen
(
yyvsp
[
0
].
a_refcomp
.
name
)
,
0
);
yyval
.
a_wchunk
=
asn1p_wsyntx_chunk_from
string
(
yyvsp
[
0
].
a_refcomp
.
name
,
0
);
yyval
.
a_wchunk
->
type
=
WC_FIELD
;
}
break
;
...
...
libasn1parser/asn1p_y.h
View file @
c46b7cb5
...
...
@@ -278,7 +278,7 @@ typedef union {
}
tv_nametag
;
}
yystype
;
/* Line 1281 of /usr/local/share/bison/yacc.c. */
#line 282 "
y.tab
.h"
#line 282 "
asn1p_y
.h"
# define YYSTYPE yystype
#endif
...
...
libasn1parser/asn1p_y.y
View file @
c46b7cb5
...
...
@@ -1123,14 +1123,14 @@ WithSyntaxList:
WithSyntaxToken:
TOK_whitespace {
$$ = asn1p_wsyntx_chunk_from
buf($1.buf, $1.len
, 0);
$$ = asn1p_wsyntx_chunk_from
string($1.buf
, 0);
$$->type = WC_WHITESPACE;
}
| TOK_Literal {
$$ = asn1p_wsyntx_chunk_from
buf($1, strlen($1)
, 0);
$$ = asn1p_wsyntx_chunk_from
string($1
, 0);
}
| PrimitiveFieldReference {
$$ = asn1p_wsyntx_chunk_from
buf($1.name, strlen($1.name)
, 0);
$$ = asn1p_wsyntx_chunk_from
string($1.name
, 0);
$$->type = WC_FIELD;
}
| '[' WithSyntaxList ']' {
...
...
skeletons/constr_SEQUENCE.c
View file @
c46b7cb5
...
...
@@ -1180,12 +1180,14 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
/* Encode a presence bitmap */
for
(
i
=
0
;
i
<
specs
->
roms_count
;
i
++
)
{
asn_TYPE_member_t
*
elm
;
void
*
memb_ptr
;
/* Pointer to the member */
void
**
memb_ptr2
;
/* Pointer to that pointer */
edx
=
specs
->
oms
[
i
];
asn_TYPE_member_t
*
elm
=
&
td
->
elements
[
edx
];
int
present
;
edx
=
specs
->
oms
[
i
];
elm
=
&
td
->
elements
[
edx
];
/* Fetch the pointer to this member */
if
(
elm
->
flags
&
ATF_POINTER
)
{
memb_ptr2
=
(
void
**
)((
char
*
)
sptr
+
elm
->
memb_offset
);
...
...
skeletons/per_decoder.h
View file @
c46b7cb5
...
...
@@ -25,27 +25,6 @@ asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx,
);
/*
* Pre-computed PER constraints.
*/
enum
asn_per_constraint_flags
{
APC_UNCONSTRAINED
=
0x0
,
/* No PER visible constraints */
APC_SEMI_CONSTRAINED
=
0x1
,
/* Constrained at "lb" */
APC_CONSTRAINED
=
0x2
,
/* Fully constrained */
APC_EXTENSIBLE
=
0x4
/* May have extension */
};
typedef
struct
asn_per_constraint_s
{
enum
asn_per_constraint_flags
flags
;
int
range_bits
;
/* Full number of bits in the range */
int
effective_bits
;
/* Effective bits */
long
lower_bound
;
/* "lb" value */
long
upper_bound
;
/* "ub" value */
}
asn_per_constraint_t
;
typedef
struct
asn_per_constraints_s
{
asn_per_constraint_t
value
;
asn_per_constraint_t
size
;
}
asn_per_constraints_t
;
/*
* Type of the type-specific PER decoder function.
*/
...
...
skeletons/per_support.h
View file @
c46b7cb5
/*
* Copyright (c) 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Copyright (c) 2005
, 2006
Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _PER_SUPPORT_H_
...
...
@@ -11,6 +11,26 @@
extern
"C"
{
#endif
/*
* Pre-computed PER constraints.
*/
typedef
struct
asn_per_constraint_s
{
enum
asn_per_constraint_flags
{
APC_UNCONSTRAINED
=
0x0
,
/* No PER visible constraints */
APC_SEMI_CONSTRAINED
=
0x1
,
/* Constrained at "lb" */
APC_CONSTRAINED
=
0x2
,
/* Fully constrained */
APC_EXTENSIBLE
=
0x4
/* May have extension */
}
flags
;
int
range_bits
;
/* Full number of bits in the range */
int
effective_bits
;
/* Effective bits */
long
lower_bound
;
/* "lb" value */
long
upper_bound
;
/* "ub" value */
}
asn_per_constraint_t
;
typedef
struct
asn_per_constraints_s
{
asn_per_constraint_t
value
;
asn_per_constraint_t
size
;
}
asn_per_constraints_t
;
/*
* This structure describes a position inside an incoming PER bit stream.
*/
...
...
@@ -20,18 +40,6 @@ typedef struct asn_per_data_s {
size_t
nbits
;
/* Number of bits in the stream */
}
asn_per_data_t
;
/*
* This structure supports forming PER output.
*/
typedef
struct
asn_per_outp_s
{
uint8_t
*
buffer
;
/* Pointer into the (tmpspace) */
size_t
nboff
;
/* Bit offset to the meaningful bit */
size_t
nbits
;
/* Number of bits left in (tmpspace) */
uint8_t
tmpspace
[
32
];
/* Preliminary storage to hold data */
int
(
*
outper
)(
const
void
*
data
,
size_t
size
,
void
*
op_key
);
void
*
op_key
;
}
asn_per_outp_t
;
/*
* Extract a small number of bits (<= 31) from the specified PER data pointer.
* This function returns -1 if the specified number of bits could not be
...
...
@@ -39,9 +47,6 @@ typedef struct asn_per_outp_s {
*/
int32_t
per_get_few_bits
(
asn_per_data_t
*
per_data
,
int
get_nbits
);
/* Output a small number of bits (<= 31) */
int
per_put_few_bits
(
asn_per_outp_t
*
per_data
,
uint32_t
bits
,
int
obits
);
/*
* Extract a large number of bits from the specified PER data pointer.
* This function returns -1 if the specified number of bits could not be
...
...
@@ -50,9 +55,6 @@ int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits);
int
per_get_many_bits
(
asn_per_data_t
*
pd
,
uint8_t
*
dst
,
int
right_align
,
int
get_nbits
);
/* Output a large number of bits */
int
per_put_many_bits
(
asn_per_outp_t
*
po
,
const
uint8_t
*
src
,
int
put_nbits
);
/*
* Get the length "n" from the Unaligned PER stream.
*/
...
...
@@ -60,6 +62,29 @@ ssize_t uper_get_length(asn_per_data_t *pd,
int
effective_bound_bits
,
int
*
repeat
);
/*
* Get the normally small non-negative whole number.
*/
ssize_t
uper_get_nsnnwn
(
asn_per_data_t
*
pd
);
/*
* This structure supports forming PER output.
*/
typedef
struct
asn_per_outp_s
{
uint8_t
*
buffer
;
/* Pointer into the (tmpspace) */
size_t
nboff
;
/* Bit offset to the meaningful bit */
size_t
nbits
;
/* Number of bits left in (tmpspace) */
uint8_t
tmpspace
[
32
];
/* Preliminary storage to hold data */
int
(
*
outper
)(
const
void
*
data
,
size_t
size
,
void
*
op_key
);
void
*
op_key
;
}
asn_per_outp_t
;
/* Output a small number of bits (<= 31) */
int
per_put_few_bits
(
asn_per_outp_t
*
per_data
,
uint32_t
bits
,
int
obits
);
/* Output a large number of bits */
int
per_put_many_bits
(
asn_per_outp_t
*
po
,
const
uint8_t
*
src
,
int
put_nbits
);
/*
* Put the length "n" to the Unaligned PER stream.
* This function returns the number of units which may be flushed
...
...
@@ -67,11 +92,6 @@ ssize_t uper_get_length(asn_per_data_t *pd,
*/
ssize_t
uper_put_length
(
asn_per_outp_t
*
po
,
size_t
whole_length
);
/*
* Get the normally small non-negative whole number.
*/
ssize_t
uper_get_nsnnwn
(
asn_per_data_t
*
pd
);
/*
* Put the normally small non-negative whole number.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment