it2s-asn securityProfile compatibility
This commit is contained in:
parent
aec88625a1
commit
bcb420990b
|
|
@ -656,13 +656,10 @@ void *ca_service(void *fc) {
|
||||||
|
|
||||||
bpr->data.buf = malloc(512);
|
bpr->data.buf = malloc(512);
|
||||||
|
|
||||||
if (facilities->use_security) {
|
|
||||||
bpr->gn.securityProfile = malloc(sizeof(long));
|
|
||||||
*bpr->gn.securityProfile = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill header for FacilitiesIndication and FacilitiesMessageIndication structs
|
// Fill header for FacilitiesIndication and FacilitiesMessageIndication structs
|
||||||
|
|
||||||
|
bpr->gn.securityProfile.sign = true;
|
||||||
|
|
||||||
FacilitiesIndication_t* fi = calloc(1,sizeof(FacilitiesIndication_t));
|
FacilitiesIndication_t* fi = calloc(1,sizeof(FacilitiesIndication_t));
|
||||||
fi->present = FacilitiesIndication_PR_message;
|
fi->present = FacilitiesIndication_PR_message;
|
||||||
FacilitiesMessageIndication_t* fmi = &fi->choice.message;
|
FacilitiesMessageIndication_t* fmi = &fi->choice.message;
|
||||||
|
|
|
||||||
|
|
@ -691,10 +691,7 @@ void *cp_service(void *fc){
|
||||||
bpr->gn.trafficClass = 2; //Identifier assigned to a GeoNetworking packet that expresses its requirements on data transport
|
bpr->gn.trafficClass = 2; //Identifier assigned to a GeoNetworking packet that expresses its requirements on data transport
|
||||||
bpr->data.buf = malloc(1500); //CPM Data to be sent to the Transport layer
|
bpr->data.buf = malloc(1500); //CPM Data to be sent to the Transport layer
|
||||||
|
|
||||||
if(facilities->use_security) {
|
bpr->gn.securityProfile.sign = true;
|
||||||
bpr->gn.securityProfile = malloc(sizeof(long));
|
|
||||||
*bpr->gn.securityProfile = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*--- Fill mandatory Facilities Message Indication parameters ---*/
|
/*--- Fill mandatory Facilities Message Indication parameters ---*/
|
||||||
fmi->itsMessageType = ItsMessageType_cpm;
|
fmi->itsMessageType = ItsMessageType_cpm;
|
||||||
|
|
|
||||||
|
|
@ -303,10 +303,7 @@ int facilities_request_single_message(facilities_t* facilities, void* responder,
|
||||||
*bpr->gn.isUpdate = 1;
|
*bpr->gn.isUpdate = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (facilities->use_security) {
|
bpr->gn.securityProfile.sign = true;
|
||||||
bpr->gn.securityProfile = malloc(sizeof(long));
|
|
||||||
*bpr->gn.securityProfile = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t tr_oer[2048];
|
uint8_t tr_oer[2048];
|
||||||
tr_oer[0] = 4; // [facilities] service id
|
tr_oer[0] = 4; // [facilities] service id
|
||||||
|
|
|
||||||
5
src/sa.c
5
src/sa.c
|
|
@ -298,10 +298,7 @@ void *sa_service(void *fc) {
|
||||||
bpr->data.buf = malloc(512);
|
bpr->data.buf = malloc(512);
|
||||||
bpr->data.size = 512;
|
bpr->data.size = 512;
|
||||||
|
|
||||||
if (facilities->use_security) {
|
bpr->gn.securityProfile.sign = true;
|
||||||
bpr->gn.securityProfile = malloc(sizeof(long));
|
|
||||||
*bpr->gn.securityProfile = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void* security_socket = zmq_socket(facilities->zmq.ctx, ZMQ_REQ);
|
void* security_socket = zmq_socket(facilities->zmq.ctx, ZMQ_REQ);
|
||||||
zmq_connect(security_socket, facilities->zmq.security_address);
|
zmq_connect(security_socket, facilities->zmq.security_address);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "tpm.h"
|
#include "tpm.h"
|
||||||
#include "facilities.h"
|
#include "facilities.h"
|
||||||
|
|
||||||
|
#include <it2s-tender/time.h>
|
||||||
#include <itss-transport/TransportRequest.h>
|
#include <itss-transport/TransportRequest.h>
|
||||||
#include <it2s-tender/space.h>
|
#include <it2s-tender/space.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
@ -12,6 +13,8 @@ int tpm_pay(void* fc) {
|
||||||
facilities_t* facilities = (facilities_t*) fc;
|
facilities_t* facilities = (facilities_t*) fc;
|
||||||
tolling_s* tolling = (tolling_s*) &facilities->tolling;
|
tolling_s* tolling = (tolling_s*) &facilities->tolling;
|
||||||
|
|
||||||
|
tolling->tz = it2s_tender_get_clock(&facilities->epv) ;
|
||||||
|
|
||||||
TransportRequest_t* tr = NULL;
|
TransportRequest_t* tr = NULL;
|
||||||
TPM_t* tpm = NULL;
|
TPM_t* tpm = NULL;
|
||||||
|
|
||||||
|
|
@ -271,6 +274,7 @@ int tpm_recv(void* fc, TPM_t* tpm_rx) {
|
||||||
syslog_debug("[facilities] [tolling] received TPM.reply, ignoring");
|
syslog_debug("[facilities] [tolling] received TPM.reply, ignoring");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
syslog_info("[facilities] [tolling] reply took %ld ms", it2s_tender_get_clock(&facilities->epv) - tolling->tz);
|
||||||
veh_handle_recv(tolling, &tpm_rx->tpm.tollingFlow.choice.reply);
|
veh_handle_recv(tolling, &tpm_rx->tpm.tollingFlow.choice.reply);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue