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
00918813
Commit
00918813
authored
Sep 18, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging
parent
efbba4ab
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
78 additions
and
71 deletions
+78
-71
examples/sample.makefile.regen
examples/sample.makefile.regen
+16
-15
examples/sample.source.LDAP3/Makefile
examples/sample.source.LDAP3/Makefile
+16
-15
examples/sample.source.RRC/Makefile
examples/sample.source.RRC/Makefile
+26
-18
examples/sample.source.RRC/sample-BCCH-BCH-Message-2-padded.per
...es/sample.source.RRC/sample-BCCH-BCH-Message-2-padded.per
+0
-0
skeletons/OCTET_STRING.c
skeletons/OCTET_STRING.c
+5
-2
skeletons/asn_codecs.h
skeletons/asn_codecs.h
+2
-0
skeletons/asn_codecs_prim.c
skeletons/asn_codecs_prim.c
+7
-19
skeletons/converter-sample.c
skeletons/converter-sample.c
+4
-2
skeletons/xer_decoder.c
skeletons/xer_decoder.c
+2
-0
No files found.
examples/sample.makefile.regen
View file @
00918813
...
@@ -57,8 +57,8 @@ cat Makefile.am.sample \
...
@@ -57,8 +57,8 @@ cat Makefile.am.sample \
echo
"
$0
"
echo
"
$0
"
echo
echo
echo
'check: ${TARGET}'
echo
'check: ${TARGET}'
echo
" @if test -f
./
sample-
${
ASN1PDU
}
-1.[db]er ; then
\\
"
echo
" @if test -f sample-
${
ASN1PDU
}
-1.[db]er ; then
\\
"
echo
" for f in
./
sample-
${
ASN1PDU
}
-*.[db]er; do
\\
"
echo
" for f in sample-
${
ASN1PDU
}
-*.[db]er; do
\\
"
echo
' echo "Recoding $$f into XER and back..."; \'
echo
' echo "Recoding $$f into XER and back..."; \'
echo
' ./${TARGET} -iber -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -iber -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -iber -oxer -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -iber -oxer -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \'
...
@@ -69,8 +69,8 @@ cat Makefile.am.sample \
...
@@ -69,8 +69,8 @@ cat Makefile.am.sample \
echo
' diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \'
echo
' diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \'
echo
' rm -f ./.tmp.[12].$$$$; \'
echo
' rm -f ./.tmp.[12].$$$$; \'
echo
' done; fi'
echo
' done; fi'
echo
" @if test -f
./
sample-
${
ASN1PDU
}
-1.xer ; then
\\
"
echo
" @if test -f sample-
${
ASN1PDU
}
-1.xer ; then
\\
"
echo
" for f in
./
sample-
${
ASN1PDU
}
-*.xer; do
\\
"
echo
" for f in sample-
${
ASN1PDU
}
-*.xer; do
\\
"
echo
' echo "Recoding $$f into DER and back..."; \'
echo
' echo "Recoding $$f into DER and back..."; \'
echo
' ./${TARGET} -ixer -oder -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -ixer -oder -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -ixer -oder -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -ixer -oder -b 17 $$f > ./.tmp.1.$$$$ || exit 2; \'
...
@@ -81,8 +81,8 @@ cat Makefile.am.sample \
...
@@ -81,8 +81,8 @@ cat Makefile.am.sample \
echo
' diff $$f ./.tmp.2.$$$$ || exit 2; \'
echo
' diff $$f ./.tmp.2.$$$$ || exit 2; \'
echo
' rm -f ./.tmp.[12].$$$$; \'
echo
' rm -f ./.tmp.[12].$$$$; \'
echo
' done; fi'
echo
' done; fi'
echo
" @if test -f
./
sample-
${
ASN1PDU
}
-1.per ; then
\\
"
echo
" @if test -f sample-
${
ASN1PDU
}
-1.per ; then
\\
"
echo
" for f in
./
sample-
${
ASN1PDU
}
-[1-9].per; do
\\
"
echo
" for f in sample-
${
ASN1PDU
}
-[1-9].per; do
\\
"
echo
' echo "Recoding $$f into DER into XER and back..."; \'
echo
' echo "Recoding $$f into DER into XER and back..."; \'
echo
' ./${TARGET} -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \'
echo
' ./${TARGET} -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \'
...
@@ -97,19 +97,20 @@ cat Makefile.am.sample \
...
@@ -97,19 +97,20 @@ cat Makefile.am.sample \
echo
' diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \'
echo
' diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 2; \'
echo
' rm -f ./.tmp.[1234].$$$$; \'
echo
' rm -f ./.tmp.[1234].$$$$; \'
echo
' done; fi'
echo
' done; fi'
echo
" @if test -f ./sample-
${
ASN1PDU
}
-1-padded.per ; then
\\
"
echo
" @if test -f sample-
${
ASN1PDU
}
-1-padded.per ; then
\\
"
echo
" for f in ./sample-
${
ASN1PDU
}
-[1-9]-padded.per; do
\\
"
echo
" for f in sample-*-[1-9]-padded.per; do
\\
"
echo
' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z-]+)-[0-9].*/\1/"`; \'
echo
' echo "Recoding byte-padded $$f into DER into XER and back..."; \'
echo
' echo "Recoding byte-padded $$f into DER into XER and back..."; \'
echo
' ./${TARGET} -per-padded -iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -
p $$pdu -
iper -oxer -b 1 $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -
p $$pdu -
iper -oxer -b 17 $$f > ./.tmp.2.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -
p $$pdu -
iper -oxer -b 33 $$f > ./.tmp.3.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -
p $$pdu -
iper -oxer -b 980 $$f > ./.tmp.4.$$$$ || exit 2; \'
echo
' diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \'
echo
' diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 2; \'
echo
' diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \'
echo
' diff ./.tmp.2.$$$$ ./.tmp.3.$$$$ || exit 2; \'
echo
' diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \'
echo
' diff ./.tmp.3.$$$$ ./.tmp.4.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -per-padded -
p $$pdu -
iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \'
echo
' ./${TARGET} -
p $$pdu -
iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 2; \'
echo
' ./${TARGET} -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${TARGET} -
p $$pdu -
ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 2; \'
echo
' diff $$f ./.tmp.1.$$$$ || exit 2; \'
echo
' diff $$f ./.tmp.1.$$$$ || exit 2; \'
echo
' rm -f ./.tmp.[1234].$$$$; \'
echo
' rm -f ./.tmp.[1234].$$$$; \'
echo
' done; fi'
echo
' done; fi'
...
...
examples/sample.source.LDAP3/Makefile
View file @
00918813
...
@@ -200,8 +200,8 @@ regen-makefile:
...
@@ -200,8 +200,8 @@ regen-makefile:
../sample.makefile.regen
../sample.makefile.regen
check
:
${TARGET}
check
:
${TARGET}
@
if
test
-f
./
sample-LDAPMessage-1.[db]er
;
then
\
@
if
test
-f
sample-LDAPMessage-1.[db]er
;
then
\
for
f
in
./
sample-LDAPMessage-
*
.[db]er
;
do
\
for
f
in
sample-LDAPMessage-
*
.[db]er
;
do
\
echo
"Recoding
$$
f into XER and back..."
;
\
echo
"Recoding
$$
f into XER and back..."
;
\
./
${TARGET}
-iber
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iber
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iber
-oxer
-b
17
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iber
-oxer
-b
17
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
...
@@ -212,8 +212,8 @@ check: ${TARGET}
...
@@ -212,8 +212,8 @@ check: ${TARGET}
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
2
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
2
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
done
;
fi
done
;
fi
@
if
test
-f
./
sample-LDAPMessage-1.xer
;
then
\
@
if
test
-f
sample-LDAPMessage-1.xer
;
then
\
for
f
in
./
sample-LDAPMessage-
*
.xer
;
do
\
for
f
in
sample-LDAPMessage-
*
.xer
;
do
\
echo
"Recoding
$$
f into DER and back..."
;
\
echo
"Recoding
$$
f into DER and back..."
;
\
./
${TARGET}
-ixer
-oder
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-ixer
-oder
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-ixer
-oder
-b
17
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-ixer
-oder
-b
17
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
...
@@ -224,8 +224,8 @@ check: ${TARGET}
...
@@ -224,8 +224,8 @@ check: ${TARGET}
diff
$$
f ./.tmp.2.
$$$$
||
exit
2
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
2
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
done
;
fi
done
;
fi
@
if
test
-f
./
sample-LDAPMessage-1.per
;
then
\
@
if
test
-f
sample-LDAPMessage-1.per
;
then
\
for
f
in
./
sample-LDAPMessage-[1-9].per
;
do
\
for
f
in
sample-LDAPMessage-[1-9].per
;
do
\
echo
"Recoding
$$
f into DER into XER and back..."
;
\
echo
"Recoding
$$
f into DER into XER and back..."
;
\
./
${TARGET}
-iper
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iper
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iper
-oxer
-b
17
$$
f
>
./.tmp.2.
$$$$
||
exit
2
;
\
./
${TARGET}
-iper
-oxer
-b
17
$$
f
>
./.tmp.2.
$$$$
||
exit
2
;
\
...
@@ -240,19 +240,20 @@ check: ${TARGET}
...
@@ -240,19 +240,20 @@ check: ${TARGET}
diff ./.tmp.1.
$$$$
./.tmp.3.
$$$$
||
exit
2
;
\
diff ./.tmp.1.
$$$$
./.tmp.3.
$$$$
||
exit
2
;
\
rm
-f
./.tmp.[1234].
$$$$
;
\
rm
-f
./.tmp.[1234].
$$$$
;
\
done
;
fi
done
;
fi
@
if
test
-f
./sample-LDAPMessage-1-padded.per
;
then
\
@
if
test
-f
sample-LDAPMessage-1-padded.per
;
then
\
for
f
in
./sample-LDAPMessage-[1-9]-padded.per
;
do
\
for
f
in
sample-
*
-[1-9]-padded.per
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z-]+)-[0-9].*/
\1
/"
`
;
\
echo
"Recoding byte-padded
$$
f into DER into XER and back..."
;
\
echo
"Recoding byte-padded
$$
f into DER into XER and back..."
;
\
./
${TARGET}
-per-padded
-iper
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-
p
$$
pdu
-
iper
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-iper
-oxer
-b
17
$$
f
>
./.tmp.2.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-
p
$$
pdu
-
iper
-oxer
-b
17
$$
f
>
./.tmp.2.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-iper
-oxer
-b
33
$$
f
>
./.tmp.3.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-
p
$$
pdu
-
iper
-oxer
-b
33
$$
f
>
./.tmp.3.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-iper
-oxer
-b
980
$$
f
>
./.tmp.4.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-
p
$$
pdu
-
iper
-oxer
-b
980
$$
f
>
./.tmp.4.
$$$$
||
exit
2
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
2
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
2
;
\
diff ./.tmp.2.
$$$$
./.tmp.3.
$$$$
||
exit
2
;
\
diff ./.tmp.2.
$$$$
./.tmp.3.
$$$$
||
exit
2
;
\
diff ./.tmp.3.
$$$$
./.tmp.4.
$$$$
||
exit
2
;
\
diff ./.tmp.3.
$$$$
./.tmp.4.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-
p
$$
pdu
-
iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
2
;
\
./
${TARGET}
-
p
$$
pdu
-
iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
2
;
\
./
${TARGET}
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-
p
$$
pdu
-
ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
2
;
\
diff
$$
f ./.tmp.1.
$$$$
||
exit
2
;
\
diff
$$
f ./.tmp.1.
$$$$
||
exit
2
;
\
rm
-f
./.tmp.[1234].
$$$$
;
\
rm
-f
./.tmp.[1234].
$$$$
;
\
done
;
fi
done
;
fi
...
...
examples/sample.source.RRC/Makefile
View file @
00918813
...
@@ -4777,8 +4777,8 @@ regen-makefile:
...
@@ -4777,8 +4777,8 @@ regen-makefile:
../sample.makefile.regen
../sample.makefile.regen
check
:
${TARGET}
check
:
${TARGET}
@
if
test
-f
./
sample-DL-DCCH-Message-1.[db]er
;
then
\
@
if
test
-f
sample-DL-DCCH-Message-1.[db]er
;
then
\
for
f
in
./
sample-DL-DCCH-Message-
*
.[db]er
;
do
\
for
f
in
sample-DL-DCCH-Message-
*
.[db]er
;
do
\
echo
"Recoding
$$
f into XER and back..."
;
\
echo
"Recoding
$$
f into XER and back..."
;
\
./
${TARGET}
-iber
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iber
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iber
-oxer
-b
17
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iber
-oxer
-b
17
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
...
@@ -4789,8 +4789,8 @@ check: ${TARGET}
...
@@ -4789,8 +4789,8 @@ check: ${TARGET}
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
2
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
2
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
done
;
fi
done
;
fi
@
if
test
-f
./
sample-DL-DCCH-Message-1.xer
;
then
\
@
if
test
-f
sample-DL-DCCH-Message-1.xer
;
then
\
for
f
in
./
sample-DL-DCCH-Message-
*
.xer
;
do
\
for
f
in
sample-DL-DCCH-Message-
*
.xer
;
do
\
echo
"Recoding
$$
f into DER and back..."
;
\
echo
"Recoding
$$
f into DER and back..."
;
\
./
${TARGET}
-ixer
-oder
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-ixer
-oder
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-ixer
-oder
-b
17
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-ixer
-oder
-b
17
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
...
@@ -4801,8 +4801,8 @@ check: ${TARGET}
...
@@ -4801,8 +4801,8 @@ check: ${TARGET}
diff
$$
f ./.tmp.2.
$$$$
||
exit
2
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
2
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
done
;
fi
done
;
fi
@
if
test
-f
./
sample-DL-DCCH-Message-1.per
;
then
\
@
if
test
-f
sample-DL-DCCH-Message-1.per
;
then
\
for
f
in
./
sample-DL-DCCH-Message-[1-9].per
;
do
\
for
f
in
sample-DL-DCCH-Message-[1-9].per
;
do
\
echo
"Recoding
$$
f into DER into XER and back..."
;
\
echo
"Recoding
$$
f into DER into XER and back..."
;
\
./
${TARGET}
-iper
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iper
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-iper
-oxer
-b
17
$$
f
>
./.tmp.2.
$$$$
||
exit
2
;
\
./
${TARGET}
-iper
-oxer
-b
17
$$
f
>
./.tmp.2.
$$$$
||
exit
2
;
\
...
@@ -4817,20 +4817,28 @@ check: ${TARGET}
...
@@ -4817,20 +4817,28 @@ check: ${TARGET}
diff ./.tmp.1.
$$$$
./.tmp.3.
$$$$
||
exit
2
;
\
diff ./.tmp.1.
$$$$
./.tmp.3.
$$$$
||
exit
2
;
\
rm
-f
./.tmp.[1234].
$$$$
;
\
rm
-f
./.tmp.[1234].
$$$$
;
\
done
;
fi
done
;
fi
@
if
test
-f
./sample-DL-DCCH-Message-1-padded.per
;
then
\
@
if
test
-f
sample-DL-DCCH-Message-1-padded.per
;
then
\
for
f
in
./sample-DL-DCCH-Message-[1-9]-padded.per
;
do
\
for
f
in
sample-
*
-[1-9]-padded.per
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z-]+)-[0-9].*/
\1
/"
`
;
\
echo
"Recoding byte-padded
$$
f into DER into XER and back..."
;
\
echo
"Recoding byte-padded
$$
f into DER into XER and back..."
;
\
./
${TARGET}
-per-padded
-iper
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
echo
"./
${TARGET}
-per-padded -p
$$
pdu -iper -oxer -b 1
$$
f > ./.tmp.1.
$$$$
"
;
\
./
${TARGET}
-per-padded
-iper
-oxer
-b
17
$$
f
>
./.tmp.2.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-p
$$
pdu
-iper
-oxer
-b
1
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-iper
-oxer
-b
33
$$
f
>
./.tmp.3.
$$$$
||
exit
2
;
\
echo
"./
${TARGET}
-per-padded -p
$$
pdu -iper -oxer -b 17
$$
f > ./.tmp.2.
$$$$
"
;
\
./
${TARGET}
-per-padded
-iper
-oxer
-b
980
$$
f
>
./.tmp.4.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-p
$$
pdu
-iper
-oxer
-b
17
$$
f
>
./.tmp.2.
$$$$
||
exit
2
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
1
;
\
echo
"./
${TARGET}
-per-padded -p
$$
pdu -iper -oxer -b 33
$$
f > ./.tmp.3.
$$$$
"
;
\
./
${TARGET}
-per-padded
-p
$$
pdu
-iper
-oxer
-b
33
$$
f
>
./.tmp.3.
$$$$
||
exit
2
;
\
echo
"./
${TARGET}
-per-padded -p
$$
pdu -iper -oxer -b 980
$$
f > ./.tmp.4.
$$$$
"
;
\
./
${TARGET}
-per-padded
-p
$$
pdu
-iper
-oxer
-b
980
$$
f
>
./.tmp.4.
$$$$
||
exit
2
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
2
;
\
diff ./.tmp.2.
$$$$
./.tmp.3.
$$$$
||
exit
2
;
\
diff ./.tmp.2.
$$$$
./.tmp.3.
$$$$
||
exit
2
;
\
diff ./.tmp.3.
$$$$
./.tmp.4.
$$$$
||
exit
3
;
\
diff ./.tmp.3.
$$$$
./.tmp.4.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
echo
"./
${TARGET}
-per-padded -p
$$
pdu -iper -oder
$$
f > ./.tmp.1.
$$$$
"
;
\
./
${TARGET}
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
2
;
\
./
${TARGET}
-per-padded
-p
$$
pdu
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${TARGET}
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
2
;
\
echo
"./
${TARGET}
-p
$$
pdu -iber -oxer ./.tmp.1.
$$$$
> ./.tmp.2.
$$$$
"
;
\
diff
$$
f ./.tmp.1.
$$$$
||
exit
4
;
\
./
${TARGET}
-p
$$
pdu
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
2
;
\
echo
"./
${TARGET}
-p
$$
pdu -ixer -oper ./.tmp.2.
$$$$
> ./.tmp.1.
$$$$
"
;
\
./
${TARGET}
-p
$$
pdu
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
2
;
\
diff
$$
f ./.tmp.1.
$$$$
||
exit
2
;
\
rm
-f
./.tmp.[1234].
$$$$
;
\
rm
-f
./.tmp.[1234].
$$$$
;
\
done
;
fi
done
;
fi
@
echo
================
@
echo
================
...
...
examples/sample.source.RRC/sample-BCCH-BCH-Message-2-padded.per
0 → 100644
View file @
00918813
File added
skeletons/OCTET_STRING.c
View file @
00918813
...
@@ -1328,8 +1328,11 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
...
@@ -1328,8 +1328,11 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
sizeinunits
=
sizeinunits
*
8
-
(
st
->
bits_unused
&
0x07
);
sizeinunits
=
sizeinunits
*
8
-
(
st
->
bits_unused
&
0x07
);
}
}
ASN_DEBUG
(
"Encoding %s into %d units of %d bits"
,
ASN_DEBUG
(
"Encoding %s into %d units of %d bits"
td
->
name
,
sizeinunits
,
unit_bits
);
" (%d..%d, effective %d)%s"
,
td
->
name
,
sizeinunits
,
unit_bits
,
ct
->
lower_bound
,
ct
->
upper_bound
,
ct
->
effective_bits
,
ct_extensible
?
" EXT"
:
""
);
/* Figure out wheter size lies within PER visible consrtaint */
/* Figure out wheter size lies within PER visible consrtaint */
...
...
skeletons/asn_codecs.h
View file @
00918813
...
@@ -62,6 +62,7 @@ typedef struct asn_enc_rval_s {
...
@@ -62,6 +62,7 @@ typedef struct asn_enc_rval_s {
tmp_error.encoded = -1; \
tmp_error.encoded = -1; \
tmp_error.failed_type = td; \
tmp_error.failed_type = td; \
tmp_error.structure_ptr = sptr; \
tmp_error.structure_ptr = sptr; \
ASN_DEBUG("Failed to encode element %s", td->name); \
return tmp_error; \
return tmp_error; \
} while(0)
} while(0)
#define _ASN_ENCODED_OK(rval) do { \
#define _ASN_ENCODED_OK(rval) do { \
...
@@ -91,6 +92,7 @@ typedef struct asn_dec_rval_s {
...
@@ -91,6 +92,7 @@ typedef struct asn_dec_rval_s {
asn_dec_rval_t tmp_error; \
asn_dec_rval_t tmp_error; \
tmp_error.code = RC_FAIL; \
tmp_error.code = RC_FAIL; \
tmp_error.consumed = 0; \
tmp_error.consumed = 0; \
ASN_DEBUG("Failed to decode element %s", td->name); \
return tmp_error; \
return tmp_error; \
} while(0)
} while(0)
#define _ASN_DECODE_STARVED do { \
#define _ASN_DECODE_STARVED do { \
...
...
skeletons/asn_codecs_prim.c
View file @
00918813
...
@@ -22,11 +22,7 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
...
@@ -22,11 +22,7 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
*/
*/
if
(
st
==
NULL
)
{
if
(
st
==
NULL
)
{
st
=
(
ASN__PRIMITIVE_TYPE_t
*
)
CALLOC
(
1
,
sizeof
(
*
st
));
st
=
(
ASN__PRIMITIVE_TYPE_t
*
)
CALLOC
(
1
,
sizeof
(
*
st
));
if
(
st
==
NULL
)
{
if
(
st
==
NULL
)
_ASN_DECODE_FAILED
;
rval
.
code
=
RC_FAIL
;
rval
.
consumed
=
0
;
return
rval
;
}
*
sptr
=
(
void
*
)
st
;
*
sptr
=
(
void
*
)
st
;
}
}
...
@@ -59,17 +55,13 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
...
@@ -59,17 +55,13 @@ ber_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
if
(
sizeof
(
st
->
size
)
!=
sizeof
(
length
)
if
(
sizeof
(
st
->
size
)
!=
sizeof
(
length
)
&&
(
ber_tlv_len_t
)
st
->
size
!=
length
)
{
&&
(
ber_tlv_len_t
)
st
->
size
!=
length
)
{
st
->
size
=
0
;
st
->
size
=
0
;
rval
.
code
=
RC_FAIL
;
_ASN_DECODE_FAILED
;
rval
.
consumed
=
0
;
return
rval
;
}
}
st
->
buf
=
(
uint8_t
*
)
MALLOC
(
length
+
1
);
st
->
buf
=
(
uint8_t
*
)
MALLOC
(
length
+
1
);
if
(
!
st
->
buf
)
{
if
(
!
st
->
buf
)
{
st
->
size
=
0
;
st
->
size
=
0
;
rval
.
code
=
RC_FAIL
;
_ASN_DECODE_FAILED
;
rval
.
consumed
=
0
;
return
rval
;
}
}
memcpy
(
st
->
buf
,
buf_ptr
,
length
);
memcpy
(
st
->
buf
,
buf_ptr
,
length
);
...
@@ -249,12 +241,7 @@ xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
...
@@ -249,12 +241,7 @@ xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
*/
*/
if
(
!*
sptr
)
{
if
(
!*
sptr
)
{
*
sptr
=
CALLOC
(
1
,
struct_size
);
*
sptr
=
CALLOC
(
1
,
struct_size
);
if
(
!*
sptr
)
{
if
(
!*
sptr
)
_ASN_DECODE_FAILED
;
asn_dec_rval_t
rval
;
rval
.
code
=
RC_FAIL
;
rval
.
consumed
=
0
;
return
rval
;
}
}
}
memset
(
&
s_ctx
,
0
,
sizeof
(
s_ctx
));
memset
(
&
s_ctx
,
0
,
sizeof
(
s_ctx
));
...
@@ -284,8 +271,7 @@ xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
...
@@ -284,8 +271,7 @@ xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
/*
/*
* This decoder does not like empty stuff.
* This decoder does not like empty stuff.
*/
*/
rc
.
code
=
RC_FAIL
;
_ASN_DECODE_FAILED
;
rc
.
consumed
=
0
;
}
}
}
}
break
;
break
;
...
@@ -300,6 +286,8 @@ xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
...
@@ -300,6 +286,8 @@ xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx,
rc
.
consumed
=
0
;
rc
.
consumed
=
0
;
if
(
s_arg
.
want_more
)
if
(
s_arg
.
want_more
)
rc
.
code
=
RC_WMORE
;
rc
.
code
=
RC_WMORE
;
else
_ASN_DECODE_FAILED
;
break
;
break
;
}
}
return
rc
;
return
rc
;
...
...
skeletons/converter-sample.c
View file @
00918813
...
@@ -665,8 +665,10 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na
...
@@ -665,8 +665,10 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na
* Print a message and return failure only if not EOF,
* Print a message and return failure only if not EOF,
* unless this is our first PDU (empty file).
* unless this is our first PDU (empty file).
*/
*/
if
((
on_first_pdu
||
new_offset
!=
old_offset
||
DynamicBuffer
.
length
)
if
(
on_first_pdu
&&
(
iform
!=
INP_XER
||
on_first_pdu
))
{
||
DynamicBuffer
.
length
||
new_offset
-
old_offset
>
((
iform
==
INP_XER
)
?
sizeof
(
"
\r\n
"
)
-
1
:
0
)
)
{
DEBUG
(
"ofp %d, no=%ld, oo=%ld, dbl=%ld"
,
DEBUG
(
"ofp %d, no=%ld, oo=%ld, dbl=%ld"
,
on_first_pdu
,
(
long
)
new_offset
,
(
long
)
old_offset
,
on_first_pdu
,
(
long
)
new_offset
,
(
long
)
old_offset
,
(
long
)
DynamicBuffer
.
length
);
(
long
)
DynamicBuffer
.
length
);
...
...
skeletons/xer_decoder.c
View file @
00918813
...
@@ -173,6 +173,8 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
...
@@ -173,6 +173,8 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
#define RETURN(_code) do { \
#define RETURN(_code) do { \
rval.code = _code; \
rval.code = _code; \
rval.consumed = consumed_myself; \
rval.consumed = consumed_myself; \
if(rval.code != RC_OK) \
ASN_DEBUG("Failed with %d", rval.code); \
return rval; \
return rval; \
} while(0)
} while(0)
...
...
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