use it2s-tender buffer size macro
This commit is contained in:
parent
20b4c89c6b
commit
c7274928b1
|
|
@ -839,7 +839,7 @@ void* ca_service() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (facilities.logging.recorder) {
|
if (facilities.logging.recorder) {
|
||||||
uint16_t buffer_len = DATA_BUFFER_SIZE;
|
uint16_t buffer_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buffer[buffer_len];
|
uint8_t buffer[buffer_len];
|
||||||
int e = itss_management_record_packet_sdu(
|
int e = itss_management_record_packet_sdu(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,7 @@ int facilities_config() {
|
||||||
DIR *d = opendir(etsi_its_cfg->facilities.protected_zones.path);
|
DIR *d = opendir(etsi_its_cfg->facilities.protected_zones.path);
|
||||||
struct dirent *dir;
|
struct dirent *dir;
|
||||||
char file[256];
|
char file[256];
|
||||||
char pz_xml[DATA_BUFFER_SIZE];
|
char pz_xml[ITSS_QUEUE_MAX_PACKET_SIZE];
|
||||||
if (d) {
|
if (d) {
|
||||||
while ((dir = readdir(d)) != NULL && i < 16) {
|
while ((dir = readdir(d)) != NULL && i < 16) {
|
||||||
if (dir->d_name[0] == '.') continue;
|
if (dir->d_name[0] == '.') continue;
|
||||||
|
|
@ -454,7 +454,7 @@ int facilities_config() {
|
||||||
DIR *d = opendir(etsi_its_cfg->facilities.tpm.tis_path);
|
DIR *d = opendir(etsi_its_cfg->facilities.tpm.tis_path);
|
||||||
struct dirent *dir;
|
struct dirent *dir;
|
||||||
char file[256];
|
char file[256];
|
||||||
char ti_xml[DATA_BUFFER_SIZE];
|
char ti_xml[ITSS_QUEUE_MAX_PACKET_SIZE];
|
||||||
if (d) {
|
if (d) {
|
||||||
while ((dir = readdir(d)) != NULL && i < TOLLING_INFOS_MAX_LENGTH) {
|
while ((dir = readdir(d)) != NULL && i < TOLLING_INFOS_MAX_LENGTH) {
|
||||||
if (dir->d_name[0] == '.') continue;
|
if (dir->d_name[0] == '.') continue;
|
||||||
|
|
|
||||||
10
src/cpm.c
10
src/cpm.c
|
|
@ -703,8 +703,8 @@ void *cp_service(){
|
||||||
memset(valid_array, 0, sizeof(valid_array));
|
memset(valid_array, 0, sizeof(valid_array));
|
||||||
memset(history_timestamp, 0, sizeof(history_timestamp));
|
memset(history_timestamp, 0, sizeof(history_timestamp));
|
||||||
|
|
||||||
uint8_t tr_oer[DATA_BUFFER_SIZE];
|
uint8_t tr_oer[ITSS_QUEUE_MAX_PACKET_SIZE];
|
||||||
uint8_t fi_oer[DATA_BUFFER_SIZE];
|
uint8_t fi_oer[ITSS_QUEUE_MAX_PACKET_SIZE];
|
||||||
tr_oer[0] = ITSS_FACILITIES; //Facilities
|
tr_oer[0] = ITSS_FACILITIES; //Facilities
|
||||||
fi_oer[0] = ITSS_FACILITIES;
|
fi_oer[0] = ITSS_FACILITIES;
|
||||||
|
|
||||||
|
|
@ -768,14 +768,14 @@ void *cp_service(){
|
||||||
fmi->id = id;
|
fmi->id = id;
|
||||||
|
|
||||||
/* Encode NetworkingRequest */
|
/* Encode NetworkingRequest */
|
||||||
asn_enc_rval_t enc_tdr = oer_encode_to_buffer(&asn_DEF_EIS_NetworkingRequest, NULL, nr, tr_oer+1, DATA_BUFFER_SIZE-1);
|
asn_enc_rval_t enc_tdr = oer_encode_to_buffer(&asn_DEF_EIS_NetworkingRequest, NULL, nr, tr_oer+1, ITSS_QUEUE_MAX_PACKET_SIZE-1);
|
||||||
if(enc_tdr.encoded == -1){
|
if(enc_tdr.encoded == -1){
|
||||||
log_error("encoding TR for cpm failed");
|
log_error("encoding TR for cpm failed");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Encode FacilitiesIndication */
|
/* Encode FacilitiesIndication */
|
||||||
asn_enc_rval_t enc_fdi = oer_encode_to_buffer(&asn_DEF_EIS_FacilitiesIndication, NULL, fi, fi_oer+1, DATA_BUFFER_SIZE-1);
|
asn_enc_rval_t enc_fdi = oer_encode_to_buffer(&asn_DEF_EIS_FacilitiesIndication, NULL, fi, fi_oer+1, ITSS_QUEUE_MAX_PACKET_SIZE-1);
|
||||||
if(enc_fdi.encoded == -1){
|
if(enc_fdi.encoded == -1){
|
||||||
log_error("encoding FI for cpm failed");
|
log_error("encoding FI for cpm failed");
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -798,7 +798,7 @@ void *cp_service(){
|
||||||
itss_db_add(facilities.logging.dbms, station_id, npr->id, true, 14, NULL, npr->data.buf, npr->data.size);
|
itss_db_add(facilities.logging.dbms, station_id, npr->id, true, 14, NULL, npr->data.buf, npr->data.size);
|
||||||
}
|
}
|
||||||
if (facilities.logging.recorder) {
|
if (facilities.logging.recorder) {
|
||||||
uint16_t buffer_len = DATA_BUFFER_SIZE;
|
uint16_t buffer_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buffer[buffer_len];
|
uint8_t buffer[buffer_len];
|
||||||
int e = itss_management_record_packet_sdu(
|
int e = itss_management_record_packet_sdu(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
|
||||||
|
|
@ -448,7 +448,7 @@ void *evcsn_service() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (facilities.logging.recorder) {
|
if (facilities.logging.recorder) {
|
||||||
uint16_t buffer_len = DATA_BUFFER_SIZE;
|
uint16_t buffer_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buffer[buffer_len];
|
uint8_t buffer[buffer_len];
|
||||||
int e = itss_management_record_packet_sdu(
|
int e = itss_management_record_packet_sdu(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,6 @@
|
||||||
#include <it2s-tender/constants.h>
|
#include <it2s-tender/constants.h>
|
||||||
#include <it2s-tender/queue.h>
|
#include <it2s-tender/queue.h>
|
||||||
|
|
||||||
#define DATA_BUFFER_SIZE 8192
|
|
||||||
|
|
||||||
enum ID_CHANGE_STAGE {
|
enum ID_CHANGE_STAGE {
|
||||||
ID_CHANGE_INACTIVE,
|
ID_CHANGE_INACTIVE,
|
||||||
ID_CHANGE_BLOCKED,
|
ID_CHANGE_BLOCKED,
|
||||||
|
|
|
||||||
|
|
@ -337,11 +337,11 @@ int facilities_request_single_message(void *responder, EIS_FacilitiesMessageRequ
|
||||||
npr->transport.choice.btp.btpType = EIS_BTPType_btpB;
|
npr->transport.choice.btp.btpType = EIS_BTPType_btpB;
|
||||||
|
|
||||||
npr->id = id;
|
npr->id = id;
|
||||||
npr->data.buf = malloc(DATA_BUFFER_SIZE);
|
npr->data.buf = malloc(ITSS_QUEUE_MAX_PACKET_SIZE);
|
||||||
|
|
||||||
asn_enc_rval_t enc;
|
asn_enc_rval_t enc;
|
||||||
if (process_msg) {
|
if (process_msg) {
|
||||||
enc = uper_encode_to_buffer(its_msg_def, NULL, its_msg, npr->data.buf, DATA_BUFFER_SIZE);
|
enc = uper_encode_to_buffer(its_msg_def, NULL, its_msg, npr->data.buf, ITSS_QUEUE_MAX_PACKET_SIZE);
|
||||||
if (enc.encoded == -1) {
|
if (enc.encoded == -1) {
|
||||||
log_error("failed encoding ITS message into UPER (%s)", enc.failed_type->name);
|
log_error("failed encoding ITS message into UPER (%s)", enc.failed_type->name);
|
||||||
rv = 1;
|
rv = 1;
|
||||||
|
|
@ -380,9 +380,9 @@ int facilities_request_single_message(void *responder, EIS_FacilitiesMessageRequ
|
||||||
|
|
||||||
npr->network.choice.gn.securityProfile.sign = true;
|
npr->network.choice.gn.securityProfile.sign = true;
|
||||||
|
|
||||||
uint8_t tr_oer[DATA_BUFFER_SIZE];
|
uint8_t tr_oer[ITSS_QUEUE_MAX_PACKET_SIZE];
|
||||||
tr_oer[0] = ITSS_FACILITIES; // [facilities] service id
|
tr_oer[0] = ITSS_FACILITIES; // [facilities] service id
|
||||||
enc = oer_encode_to_buffer(&asn_DEF_EIS_NetworkingRequest, NULL, nr, tr_oer + 1, DATA_BUFFER_SIZE-1);
|
enc = oer_encode_to_buffer(&asn_DEF_EIS_NetworkingRequest, NULL, nr, tr_oer + 1, ITSS_QUEUE_MAX_PACKET_SIZE-1);
|
||||||
if (enc.encoded == -1) {
|
if (enc.encoded == -1) {
|
||||||
log_error("failed encoding TR (%s)", enc.failed_type->name);
|
log_error("failed encoding TR (%s)", enc.failed_type->name);
|
||||||
rv = 1;
|
rv = 1;
|
||||||
|
|
@ -394,7 +394,7 @@ int facilities_request_single_message(void *responder, EIS_FacilitiesMessageRequ
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
if (facilities.logging.recorder) {
|
if (facilities.logging.recorder) {
|
||||||
uint16_t buffer_len = DATA_BUFFER_SIZE;
|
uint16_t buffer_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buffer[buffer_len];
|
uint8_t buffer[buffer_len];
|
||||||
int e = itss_management_record_packet_sdu(
|
int e = itss_management_record_packet_sdu(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
@ -457,8 +457,8 @@ int facilities_request_active_episodes(void *responder, EIS_FacilitiesRequest_t
|
||||||
if (facilities.den.events[i]->enabled && facilities.den.events[i]->state == EVENT_ACTIVE) {
|
if (facilities.den.events[i]->enabled && facilities.den.events[i]->state == EVENT_ACTIVE) {
|
||||||
frep->choice.data.choice.episodes.list.array[j] = calloc(1, sizeof(EIS_ItsMessage_t));
|
frep->choice.data.choice.episodes.list.array[j] = calloc(1, sizeof(EIS_ItsMessage_t));
|
||||||
frep->choice.data.choice.episodes.list.array[j]->itsMessageType = EIS_ItsMessageType_denm;
|
frep->choice.data.choice.episodes.list.array[j]->itsMessageType = EIS_ItsMessageType_denm;
|
||||||
frep->choice.data.choice.episodes.list.array[j]->data.buf = malloc(DATA_BUFFER_SIZE);
|
frep->choice.data.choice.episodes.list.array[j]->data.buf = malloc(ITSS_QUEUE_MAX_PACKET_SIZE);
|
||||||
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EI1_DENM, NULL, facilities.den.events[i]->denm, frep->choice.data.choice.episodes.list.array[j]->data.buf, DATA_BUFFER_SIZE);
|
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EI1_DENM, NULL, facilities.den.events[i]->denm, frep->choice.data.choice.episodes.list.array[j]->data.buf, ITSS_QUEUE_MAX_PACKET_SIZE);
|
||||||
if (enc.encoded == -1) { /* encoding shouldn't fail as all saved DENMs are structurally valid */
|
if (enc.encoded == -1) { /* encoding shouldn't fail as all saved DENMs are structurally valid */
|
||||||
log_error("failed encoding DENM for FDResult (%s)", enc.failed_type->name);
|
log_error("failed encoding DENM for FDResult (%s)", enc.failed_type->name);
|
||||||
frep->choice.data.choice.episodes.list.array[j]->data.size = 0;
|
frep->choice.data.choice.episodes.list.array[j]->data.size = 0;
|
||||||
|
|
@ -475,8 +475,8 @@ int facilities_request_active_episodes(void *responder, EIS_FacilitiesRequest_t
|
||||||
if (facilities.infrastructure.services[i]->enabled && facilities.infrastructure.services[i]->state == SERVICE_ACTIVE) {
|
if (facilities.infrastructure.services[i]->enabled && facilities.infrastructure.services[i]->state == SERVICE_ACTIVE) {
|
||||||
frep->choice.data.choice.episodes.list.array[j] = calloc(1, sizeof(EIS_ItsMessage_t));
|
frep->choice.data.choice.episodes.list.array[j] = calloc(1, sizeof(EIS_ItsMessage_t));
|
||||||
frep->choice.data.choice.episodes.list.array[j]->itsMessageType = EIS_ItsMessageType_ivim;
|
frep->choice.data.choice.episodes.list.array[j]->itsMessageType = EIS_ItsMessageType_ivim;
|
||||||
frep->choice.data.choice.episodes.list.array[j]->data.buf = malloc(DATA_BUFFER_SIZE);
|
frep->choice.data.choice.episodes.list.array[j]->data.buf = malloc(ITSS_QUEUE_MAX_PACKET_SIZE);
|
||||||
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EI1_IVIM, NULL, facilities.infrastructure.services[i]->ivim, frep->choice.data.choice.episodes.list.array[j]->data.buf, DATA_BUFFER_SIZE);
|
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EI1_IVIM, NULL, facilities.infrastructure.services[i]->ivim, frep->choice.data.choice.episodes.list.array[j]->data.buf, ITSS_QUEUE_MAX_PACKET_SIZE);
|
||||||
if (enc.encoded == -1) { /* encoding shouldn't fail as all saved DENMs are structurally valid */
|
if (enc.encoded == -1) { /* encoding shouldn't fail as all saved DENMs are structurally valid */
|
||||||
log_error("failed encoding IVIM for FDResult (%s)", enc.failed_type->name);
|
log_error("failed encoding IVIM for FDResult (%s)", enc.failed_type->name);
|
||||||
frep->choice.data.choice.episodes.list.array[j]->data.size = 0;
|
frep->choice.data.choice.episodes.list.array[j]->data.size = 0;
|
||||||
|
|
@ -659,7 +659,7 @@ static int networking_packet_indication_btp(EIS_NetworkingPacketIndication_t* np
|
||||||
bool stored = false;
|
bool stored = false;
|
||||||
bool process_msg = true;
|
bool process_msg = true;
|
||||||
|
|
||||||
uint16_t buf_len = DATA_BUFFER_SIZE;
|
uint16_t buf_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buf[buf_len];
|
uint8_t buf[buf_len];
|
||||||
|
|
||||||
uint64_t id = 0;
|
uint64_t id = 0;
|
||||||
|
|
@ -944,7 +944,7 @@ static int networking_packet_indication_tcp(EIS_NetworkingPacketIndication_t* np
|
||||||
|
|
||||||
EIS_TCPPacketIndication_t* tpi = &npi->transport.choice.tcp;
|
EIS_TCPPacketIndication_t* tpi = &npi->transport.choice.tcp;
|
||||||
|
|
||||||
uint16_t buf_len = DATA_BUFFER_SIZE;
|
uint16_t buf_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buf[buf_len];
|
uint8_t buf[buf_len];
|
||||||
|
|
||||||
EIS_SecurityRequest_t* sreq = NULL;
|
EIS_SecurityRequest_t* sreq = NULL;
|
||||||
|
|
@ -973,13 +973,13 @@ static int networking_packet_indication_tcp(EIS_NetworkingPacketIndication_t* np
|
||||||
pthread_mutex_unlock(&facilities.tolling.lock);
|
pthread_mutex_unlock(&facilities.tolling.lock);
|
||||||
sreq->choice.tlsSend.connId = id;
|
sreq->choice.tlsSend.connId = id;
|
||||||
|
|
||||||
uint8_t b_tx[DATA_BUFFER_SIZE], b_rx[DATA_BUFFER_SIZE];
|
uint8_t b_tx[ITSS_QUEUE_MAX_PACKET_SIZE], b_rx[ITSS_QUEUE_MAX_PACKET_SIZE];
|
||||||
b_tx[0] = ITSS_FACILITIES;
|
b_tx[0] = ITSS_FACILITIES;
|
||||||
asn_enc_rval_t enc = oer_encode_to_buffer(&asn_DEF_EIS_SecurityRequest, NULL, sreq, b_tx + 1, DATA_BUFFER_SIZE-1);
|
asn_enc_rval_t enc = oer_encode_to_buffer(&asn_DEF_EIS_SecurityRequest, NULL, sreq, b_tx + 1, ITSS_QUEUE_MAX_PACKET_SIZE-1);
|
||||||
|
|
||||||
log_debug("->[security] SecurityRequest.tlsRecv (%ldB)", enc.encoded + 1);
|
log_debug("->[security] SecurityRequest.tlsRecv (%ldB)", enc.encoded + 1);
|
||||||
itss_0send(*security_socket, b_tx, enc.encoded + 1);
|
itss_0send(*security_socket, b_tx, enc.encoded + 1);
|
||||||
int32_t rl = itss_0recv_rt(security_socket, b_rx, DATA_BUFFER_SIZE, b_tx, enc.encoded + 1, 1000);
|
int32_t rl = itss_0recv_rt(security_socket, b_rx, ITSS_QUEUE_MAX_PACKET_SIZE, b_tx, enc.encoded + 1, 1000);
|
||||||
log_debug("<-[security] SecurityReply.tlsRecv (%dB)", rl);
|
log_debug("<-[security] SecurityReply.tlsRecv (%dB)", rl);
|
||||||
|
|
||||||
if (oer_decode(NULL, &asn_DEF_EIS_SecurityReply, (void **)&srep, b_rx, rl).code) {
|
if (oer_decode(NULL, &asn_DEF_EIS_SecurityReply, (void **)&srep, b_rx, rl).code) {
|
||||||
|
|
@ -995,10 +995,10 @@ static int networking_packet_indication_tcp(EIS_NetworkingPacketIndication_t* np
|
||||||
sREQ->present = EIS_SecurityRequest_PR_tlsShutdown;
|
sREQ->present = EIS_SecurityRequest_PR_tlsShutdown;
|
||||||
sREQ->choice.tlsShutdown.connId = id;
|
sREQ->choice.tlsShutdown.connId = id;
|
||||||
b_tx[0] = ITSS_FACILITIES;
|
b_tx[0] = ITSS_FACILITIES;
|
||||||
asn_enc_rval_t enc = oer_encode_to_buffer(&asn_DEF_EIS_SecurityRequest, NULL, sREQ, b_tx + 1, DATA_BUFFER_SIZE-1);
|
asn_enc_rval_t enc = oer_encode_to_buffer(&asn_DEF_EIS_SecurityRequest, NULL, sREQ, b_tx + 1, ITSS_QUEUE_MAX_PACKET_SIZE-1);
|
||||||
log_debug("->[security] SecurityRequest.tlsShutdown (%ldB)", enc.encoded + 1);
|
log_debug("->[security] SecurityRequest.tlsShutdown (%ldB)", enc.encoded + 1);
|
||||||
itss_0send(*security_socket, b_tx, enc.encoded + 1);
|
itss_0send(*security_socket, b_tx, enc.encoded + 1);
|
||||||
int32_t rl = itss_0recv_rt(security_socket, b_rx, DATA_BUFFER_SIZE, b_tx, enc.encoded + 1, 1000);
|
int32_t rl = itss_0recv_rt(security_socket, b_rx, ITSS_QUEUE_MAX_PACKET_SIZE, b_tx, enc.encoded + 1, 1000);
|
||||||
log_debug("<-[security] SecurityReply.tlsShutdown (%dB)", rl);
|
log_debug("<-[security] SecurityReply.tlsShutdown (%dB)", rl);
|
||||||
|
|
||||||
rv = 1;
|
rv = 1;
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ void *sa_service() {
|
||||||
itss_db_add(facilities.logging.dbms, station_id, npr->id, true, EI1_messageID_saem, NULL, npr->data.buf, npr->data.size);
|
itss_db_add(facilities.logging.dbms, station_id, npr->id, true, EI1_messageID_saem, NULL, npr->data.buf, npr->data.size);
|
||||||
}
|
}
|
||||||
if (facilities.logging.recorder) {
|
if (facilities.logging.recorder) {
|
||||||
uint16_t buffer_len = DATA_BUFFER_SIZE;
|
uint16_t buffer_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buffer[buffer_len];
|
uint8_t buffer[buffer_len];
|
||||||
int e = itss_management_record_packet_sdu(
|
int e = itss_management_record_packet_sdu(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
|
||||||
16
src/tpm.c
16
src/tpm.c
|
|
@ -67,7 +67,7 @@ int tpm_pay(tolling_info_t* info, void** security_socket, uint8_t* neighbour, ui
|
||||||
|
|
||||||
tolling_t* tolling = (tolling_t*) &facilities.tolling;
|
tolling_t* tolling = (tolling_t*) &facilities.tolling;
|
||||||
|
|
||||||
const size_t buf_len = DATA_BUFFER_SIZE;
|
const size_t buf_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t tpm_uper[buf_len];
|
uint8_t tpm_uper[buf_len];
|
||||||
uint8_t buf1[buf_len], buf2[buf_len];
|
uint8_t buf1[buf_len], buf2[buf_len];
|
||||||
|
|
||||||
|
|
@ -211,7 +211,7 @@ int tpm_pay(tolling_info_t* info, void** security_socket, uint8_t* neighbour, ui
|
||||||
memcpy(sreq->choice.sign.data.buf, buf1, enc.encoded);
|
memcpy(sreq->choice.sign.data.buf, buf1, enc.encoded);
|
||||||
|
|
||||||
buf2[0] = ITSS_FACILITIES;
|
buf2[0] = ITSS_FACILITIES;
|
||||||
enc = oer_encode_to_buffer(&asn_DEF_EIS_SecurityRequest, NULL, sreq, buf2+1, DATA_BUFFER_SIZE-1);
|
enc = oer_encode_to_buffer(&asn_DEF_EIS_SecurityRequest, NULL, sreq, buf2+1, ITSS_QUEUE_MAX_PACKET_SIZE-1);
|
||||||
log_debug("->[security] SecurityRequest.sign (%ldB)", enc.encoded+1);
|
log_debug("->[security] SecurityRequest.sign (%ldB)", enc.encoded+1);
|
||||||
itss_0send(*security_socket, buf2, enc.encoded+1);
|
itss_0send(*security_socket, buf2, enc.encoded+1);
|
||||||
int32_t rl = itss_0recv_rt(security_socket, buf1, buf_len, buf2, enc.encoded+1, 1000);
|
int32_t rl = itss_0recv_rt(security_socket, buf1, buf_len, buf2, enc.encoded+1, 1000);
|
||||||
|
|
@ -421,7 +421,7 @@ int tpm_pay(tolling_info_t* info, void** security_socket, uint8_t* neighbour, ui
|
||||||
itss_queue_send(facilities.tx_queue, itss_queue_packet_new(buf1, enc.encoded+1, ITSS_APPLICATIONS, id, "FI.message (TPM.request)"));
|
itss_queue_send(facilities.tx_queue, itss_queue_packet_new(buf1, enc.encoded+1, ITSS_APPLICATIONS, id, "FI.message (TPM.request)"));
|
||||||
|
|
||||||
if (facilities.logging.recorder) {
|
if (facilities.logging.recorder) {
|
||||||
uint16_t buffer_len = DATA_BUFFER_SIZE;
|
uint16_t buffer_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buffer[buffer_len];
|
uint8_t buffer[buffer_len];
|
||||||
int e = itss_management_record_packet_sdu(
|
int e = itss_management_record_packet_sdu(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
@ -1037,7 +1037,7 @@ static int rsu_handle_recv(EI1_TPM_t* tpm_rx, void** security_socket, uint8_t* n
|
||||||
|
|
||||||
itss_queue_send(facilities.tx_queue, itss_queue_packet_new(buf1, enc.encoded+1, ITSS_APPLICATIONS, id, "FI.message (TPM.reply)"));
|
itss_queue_send(facilities.tx_queue, itss_queue_packet_new(buf1, enc.encoded+1, ITSS_APPLICATIONS, id, "FI.message (TPM.reply)"));
|
||||||
if (facilities.logging.recorder) {
|
if (facilities.logging.recorder) {
|
||||||
uint16_t buffer_len = DATA_BUFFER_SIZE;
|
uint16_t buffer_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buffer[buffer_len];
|
uint8_t buffer[buffer_len];
|
||||||
int e = itss_management_record_packet_sdu(
|
int e = itss_management_record_packet_sdu(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
@ -1080,7 +1080,7 @@ static int veh_handle_recv(tolling_t* tolling, EI1_TPM_t* tpm_rx, void** securit
|
||||||
EIS_SecurityReply_t* srep = NULL;
|
EIS_SecurityReply_t* srep = NULL;
|
||||||
EIS_NetworkingRequest_t* tr = NULL;
|
EIS_NetworkingRequest_t* tr = NULL;
|
||||||
|
|
||||||
const uint16_t buf_len = DATA_BUFFER_SIZE;
|
const uint16_t buf_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buf1[buf_len], buf2[buf_len];
|
uint8_t buf1[buf_len], buf2[buf_len];
|
||||||
|
|
||||||
switch (type_rx->present) {
|
switch (type_rx->present) {
|
||||||
|
|
@ -1098,8 +1098,8 @@ static int veh_handle_recv(tolling_t* tolling, EI1_TPM_t* tpm_rx, void** securit
|
||||||
info_id = type_rx->choice.entry.choice.reply.infoId;
|
info_id = type_rx->choice.entry.choice.reply.infoId;
|
||||||
confirmation_code = type_rx->choice.entry.choice.reply.confirmationCode;
|
confirmation_code = type_rx->choice.entry.choice.reply.confirmationCode;
|
||||||
|
|
||||||
uint8_t b_tep[DATA_BUFFER_SIZE];
|
uint8_t b_tep[ITSS_QUEUE_MAX_PACKET_SIZE];
|
||||||
asn_enc_rval_t e_tep = uper_encode_to_buffer(&asn_DEF_EI1_TPM, NULL, tpm_rx, b_tep, DATA_BUFFER_SIZE);
|
asn_enc_rval_t e_tep = uper_encode_to_buffer(&asn_DEF_EI1_TPM, NULL, tpm_rx, b_tep, ITSS_QUEUE_MAX_PACKET_SIZE);
|
||||||
if (e_tep.encoded == -1) {
|
if (e_tep.encoded == -1) {
|
||||||
log_error("[tolling] error encoding received TPM as entry proof");
|
log_error("[tolling] error encoding received TPM as entry proof");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -1189,7 +1189,7 @@ static int veh_handle_recv(tolling_t* tolling, EI1_TPM_t* tpm_rx, void** securit
|
||||||
sreq->choice.verify.type = tpm_rx->tpmSignature->type;
|
sreq->choice.verify.type = tpm_rx->tpmSignature->type;
|
||||||
|
|
||||||
buf1[0] = ITSS_FACILITIES;
|
buf1[0] = ITSS_FACILITIES;
|
||||||
enc = oer_encode_to_buffer(&asn_DEF_EIS_SecurityRequest, NULL, sreq, buf1+1, DATA_BUFFER_SIZE-1);
|
enc = oer_encode_to_buffer(&asn_DEF_EIS_SecurityRequest, NULL, sreq, buf1+1, ITSS_QUEUE_MAX_PACKET_SIZE-1);
|
||||||
log_debug("->[security] SecurityRequest.verify (%ldB)", enc.encoded+1);
|
log_debug("->[security] SecurityRequest.verify (%ldB)", enc.encoded+1);
|
||||||
itss_0send(*security_socket, buf1, enc.encoded+1);
|
itss_0send(*security_socket, buf1, enc.encoded+1);
|
||||||
int32_t rl = itss_0recv_rt(security_socket, buf2, buf_len, buf1, enc.encoded+1, 1000);
|
int32_t rl = itss_0recv_rt(security_socket, buf2, buf_len, buf1, enc.encoded+1, 1000);
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ static mc_neighbour_s* get_neighbour(uint32_t station_id) {
|
||||||
|
|
||||||
|
|
||||||
static void tx_vcm(EI1_VCM_t* vcm) {
|
static void tx_vcm(EI1_VCM_t* vcm) {
|
||||||
const uint16_t buf_len = DATA_BUFFER_SIZE;
|
const uint16_t buf_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buf[buf_len];
|
uint8_t buf[buf_len];
|
||||||
EIS_NetworkingRequest_t* nr = NULL;
|
EIS_NetworkingRequest_t* nr = NULL;
|
||||||
EIS_FacilitiesIndication_t* fi = NULL;
|
EIS_FacilitiesIndication_t* fi = NULL;
|
||||||
|
|
@ -149,7 +149,7 @@ static void tx_vcm(EI1_VCM_t* vcm) {
|
||||||
facilities.coordination.t_last_send_vcm = itss_time_get();
|
facilities.coordination.t_last_send_vcm = itss_time_get();
|
||||||
|
|
||||||
if (facilities.logging.recorder) {
|
if (facilities.logging.recorder) {
|
||||||
uint16_t buffer_len = DATA_BUFFER_SIZE;
|
uint16_t buffer_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buffer[buffer_len];
|
uint8_t buffer[buffer_len];
|
||||||
int e = itss_management_record_packet_sdu(
|
int e = itss_management_record_packet_sdu(
|
||||||
buffer,
|
buffer,
|
||||||
|
|
@ -200,7 +200,7 @@ static void vcm_reject(EI1_VCM_t* vcm, mc_neighbour_s* neighbour) {
|
||||||
EI1_VCM_t* vcm_rep = calloc(1, sizeof(EI1_VCM_t));
|
EI1_VCM_t* vcm_rep = calloc(1, sizeof(EI1_VCM_t));
|
||||||
|
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
const uint16_t buf_len = DATA_BUFFER_SIZE;
|
const uint16_t buf_len = ITSS_QUEUE_MAX_PACKET_SIZE;
|
||||||
uint8_t buf1[buf_len];
|
uint8_t buf1[buf_len];
|
||||||
|
|
||||||
vcm_rep->header.messageID = 43;
|
vcm_rep->header.messageID = 43;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue