Do not decode UPF packets

This commit is contained in:
emanuelv 2023-12-19 10:57:05 +00:00
parent 2232d847ab
commit 1d183363dc
1 changed files with 13 additions and 7 deletions

View File

@ -337,15 +337,21 @@ int facilities_request_single_message(void *responder, FacilitiesMessageRequest_
npr->transport.choice.btp.btpType = BTPType_btpB; npr->transport.choice.btp.btpType = BTPType_btpB;
npr->id = id; npr->id = id;
npr->data.buf = malloc(2048); npr->data.buf = malloc(2048);
asn_enc_rval_t enc = uper_encode_to_buffer(its_msg_def, NULL, its_msg, npr->data.buf, 2048);
if (enc.encoded == -1) { asn_enc_rval_t enc;
log_error("failed encoding ITS message into UPER (%s)", enc.failed_type->name); if (process_msg) {
rv = 1; enc = uper_encode_to_buffer(its_msg_def, NULL, its_msg, npr->data.buf, 2048);
goto cleanup; if (enc.encoded == -1) {
log_error("failed encoding ITS message into UPER (%s)", enc.failed_type->name);
rv = 1;
goto cleanup;
}
npr->data.size = (enc.encoded + 7) / 8;
} else {
memcpy(npr->data.buf, frm->data.buf, frm->data.size);
npr->data.size = frm->data.size;
} }
npr->data.size = (enc.encoded + 7) / 8;
npr->network.choice.gn.destinationAddress.buf = malloc(6); npr->network.choice.gn.destinationAddress.buf = malloc(6);
for (int i = 0; i < 6; ++i) for (int i = 0; i < 6; ++i)