complex data

This commit is contained in:
Lev Walkin 2007-06-24 08:45:31 +00:00
parent 7608b04e96
commit 73a5cc6587
2 changed files with 22 additions and 7 deletions

View File

@ -238,14 +238,30 @@ compare_with_data_out(const char *fname, char *buf, int size) {
fprintf(stderr, "Comparing PER output with [%s]\n", outName);
if(strstr(outName, "-0-6-P.out")) {
if(strstr(outName, "-06-P.out")) {
f = fopen(outName, "w");
fbuf[0] = 0x81;
fbuf[1] = 0x40;
fbuf[2] = 0x00;
fwrite(fbuf, 1, 3, f);
fclose(f);
}
if(strstr(outName, "-07-P.out")) {
f = fopen(outName, "w");
fbuf[0] = 0x81;
fbuf[1] = 0x40;
fbuf[2] = 0x40;
fwrite(fbuf, 1, 3, f);
fclose(f);
}
if(strstr(outName, "-08-P.out")) {
f = fopen(outName, "w");
fbuf[0] = 0x81;
fbuf[1] = 0x40;
fbuf[2] = 0x80;
fbuf[3] = 0x00;
fbuf[4] = 0x00;
fwrite(fbuf, 1, 5, f);
fwrite(fbuf, 1, 3, f);
fclose(f);
}

View File

@ -1249,6 +1249,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
}
/* Prepare a place and read-in the presence bitmap */
memset(&opmd, 0, sizeof(opmd));
if(specs->roms_count) {
opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
if(!opres) _ASN_DECODE_FAILED;
@ -1258,13 +1259,11 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
_ASN_DECODE_STARVED;
}
opmd.buffer = opres;
opmd.nboff = 0;
opmd.nbits = specs->roms_count;
ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
td->name, specs->roms_count, *opres);
} else {
opres = 0;
memset(&opmd, 0, sizeof opmd);
}
/*
@ -1342,8 +1341,8 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
if(per_get_many_bits(pd, epres, 0, bmlength))
_ASN_DECODE_STARVED;
memset(&epmd, 0, sizeof(epmd));
epmd.buffer = epres;
epmd.nboff = 0;
epmd.nbits = bmlength;
ASN_DEBUG("Read in extensions bitmap for %s of %d bits (%x..)",
td->name, bmlength, *epres);