generalized the EVMessages and added evrsrm
This commit is contained in:
parent
b31988f1b2
commit
119593d8e1
|
|
@ -13,6 +13,11 @@
|
||||||
"asn_application.h": "c",
|
"asn_application.h": "c",
|
||||||
"itspduheader.h": "c",
|
"itspduheader.h": "c",
|
||||||
"evchargingspotnotificationpoimessage.h": "c",
|
"evchargingspotnotificationpoimessage.h": "c",
|
||||||
"vcm.h": "c"
|
"vcm.h": "c",
|
||||||
|
"cam.h": "c",
|
||||||
|
"facilities.h": "c",
|
||||||
|
"indications.h": "c",
|
||||||
|
"time.h": "c",
|
||||||
|
"stdint.h": "c"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -10,7 +10,7 @@ ADD_EXECUTABLE(it2s-itss-facilities
|
||||||
saem.c
|
saem.c
|
||||||
tpm.c
|
tpm.c
|
||||||
vcm.c
|
vcm.c
|
||||||
evcsnm.c
|
evm.c
|
||||||
)
|
)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(it2s-itss-facilities
|
TARGET_LINK_LIBRARIES(it2s-itss-facilities
|
||||||
|
|
@ -30,6 +30,7 @@ TARGET_LINK_LIBRARIES(it2s-itss-facilities
|
||||||
-lit2s-asn-tpm
|
-lit2s-asn-tpm
|
||||||
-lit2s-asn-vcm
|
-lit2s-asn-vcm
|
||||||
-lit2s-asn-evcsnm
|
-lit2s-asn-evcsnm
|
||||||
|
-lit2s-asn-evrsrm
|
||||||
-lit2s-asn-verco
|
-lit2s-asn-verco
|
||||||
-lit2s-tender
|
-lit2s-tender
|
||||||
-lit2s-obd
|
-lit2s-obd
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@ int facilities_config() {
|
||||||
facilities.coordination.vcm_period_max = config->facilities.mcm.period_max;
|
facilities.coordination.vcm_period_max = config->facilities.mcm.period_max;
|
||||||
|
|
||||||
// EVCSNM
|
// EVCSNM
|
||||||
facilities.evcsnm_args.activate = config->facilities.evcsnm.activate;
|
facilities.evm_args.activate = config->facilities.evcsnm.activate;
|
||||||
|
|
||||||
// Replay
|
// Replay
|
||||||
facilities.replay = config->networking.replay.activate;
|
facilities.replay = config->networking.replay.activate;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "evcsnm.h"
|
#include "evm.h"
|
||||||
#include "facilities.h"
|
#include "facilities.h"
|
||||||
|
|
||||||
#include <it2s-asn/itss-transport/TransportRequest.h>
|
#include <it2s-asn/itss-transport/TransportRequest.h>
|
||||||
|
|
@ -126,12 +126,22 @@ int evcsnm_check(EvcsnPdu_t *evcsnm)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum EVCSNM_CHECK_R check_evcsnm(BTPPacketIndication_t *bpi, EvcsnPdu_t *evcsnm, uint8_t *ssp, uint32_t ssp_len)
|
|
||||||
{
|
|
||||||
int rv = 0;
|
|
||||||
|
|
||||||
return rv;
|
int evrsrm_check(EV_RSR_t *evrsrm)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EVM_CHECK_R check_evcsnm(BTPPacketIndication_t *bpi, EvcsnPdu_t *evcsnm, uint8_t *ssp, uint32_t ssp_len)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum EVM_CHECK_R check_evrsrm(BTPPacketIndication_t *bpi, EV_RSR_t *evrsrm, uint8_t *ssp, uint32_t ssp_len)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void *evcsn_service()
|
void *evcsn_service()
|
||||||
{
|
{
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
@ -176,7 +186,7 @@ void *evcsn_service()
|
||||||
while (!facilities.exit)
|
while (!facilities.exit)
|
||||||
{
|
{
|
||||||
usleep(1000 * 1000);
|
usleep(1000 * 1000);
|
||||||
if (facilities.evcsnm_args.activate)
|
if (facilities.evm_args.activate)
|
||||||
{
|
{
|
||||||
rv = mk_evcsnm(bpr->data.buf, (uint32_t *)&bpr->data.size);
|
rv = mk_evcsnm(bpr->data.buf, (uint32_t *)&bpr->data.size);
|
||||||
if (rv)
|
if (rv)
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef FACILITIES_EVCSNM_H
|
#ifndef FACILITIES_EVM_H
|
||||||
#define FACILITIES_EVCSNM_H
|
#define FACILITIES_EVM_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
@ -7,17 +7,15 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <it2s-asn/evcsnm/EvcsnPdu.h>
|
#include <it2s-asn/evcsnm/EvcsnPdu.h>
|
||||||
|
#include <it2s-asn/evrsrm/EV-RSR.h>
|
||||||
#include <it2s-asn/itss-transport/BTPPacketIndication.h>
|
#include <it2s-asn/itss-transport/BTPPacketIndication.h>
|
||||||
|
|
||||||
#include <it2s-tender/epv.h>
|
#include <it2s-tender/epv.h>
|
||||||
|
|
||||||
#define POS_HISTORY_MAX_LEN 24
|
enum EVM_CHECK_R {
|
||||||
#define PATH_HISTORY_MAX_LEN POS_HISTORY_MAX_LEN-1
|
EVM_OK,
|
||||||
|
EVM_INVALID,
|
||||||
enum EVCSNM_CHECK_R {
|
EVM_BAD_PERMISSIONS
|
||||||
EVCSNM_OK,
|
|
||||||
EVCSNM_INVALID,
|
|
||||||
EVCSNM_BAD_PERMISSIONS
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -25,7 +23,8 @@ enum EVCSNM_CHECK_R {
|
||||||
*
|
*
|
||||||
* @return A EVCSNM check code
|
* @return A EVCSNM check code
|
||||||
*/
|
*/
|
||||||
enum EVCSNM_CHECK_R check_evcsnm(BTPPacketIndication_t *bpi, EvcsnPdu_t *evcsnm, uint8_t *ssp, uint32_t ssp_len);
|
enum EVM_CHECK_R check_evcsnm(BTPPacketIndication_t *bpi, EvcsnPdu_t *evcsnm, uint8_t *ssp, uint32_t ssp_len);
|
||||||
|
enum EVM_CHECK_R check_evrsrm(BTPPacketIndication_t *bpi, EV_RSR_t *evrsrm, uint8_t *ssp, uint32_t ssp_len);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Main CA service
|
* @brief Main CA service
|
||||||
|
|
@ -40,9 +39,10 @@ void* evcsn_service();
|
||||||
* @return 0 on success, other value otherwise
|
* @return 0 on success, other value otherwise
|
||||||
*/
|
*/
|
||||||
int evcsnm_check(EvcsnPdu_t* evcsnm);
|
int evcsnm_check(EvcsnPdu_t* evcsnm);
|
||||||
|
int evrsrm_check(EV_RSR_t *evrsrm);
|
||||||
|
|
||||||
typedef struct evcsnm_args {
|
typedef struct evm_args {
|
||||||
bool activate;
|
bool activate;
|
||||||
} evcsnm_args_t;
|
} evm_args_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
#include "saem.h"
|
#include "saem.h"
|
||||||
#include "tpm.h"
|
#include "tpm.h"
|
||||||
#include "vcm.h"
|
#include "vcm.h"
|
||||||
#include "evcsnm.h"
|
#include "evm.h"
|
||||||
|
|
||||||
#include <it2s-asn/itss-networking/NetworkingIndication.h>
|
#include <it2s-asn/itss-networking/NetworkingIndication.h>
|
||||||
#include <it2s-asn/itss-transport/TransportRequest.h>
|
#include <it2s-asn/itss-transport/TransportRequest.h>
|
||||||
|
|
@ -171,6 +171,14 @@ static int transport_indication(void *responder, void **security_socket, uint8_t
|
||||||
handled_msg = true;
|
handled_msg = true;
|
||||||
fwd = true;
|
fwd = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Port_evrsr: /* EVRSRM */
|
||||||
|
its_msg_descriptor = &asn_DEF_EV_RSR;
|
||||||
|
its_msg = calloc(1, sizeof(EV_RSR_t));
|
||||||
|
its_msg_type = messageID_evcsn;
|
||||||
|
handled_msg = true;
|
||||||
|
fwd = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_debug("messsage with unhandled BTP port received (%lld), ignoring", tpi->choice.btp.destinationPort);
|
log_debug("messsage with unhandled BTP port received (%lld), ignoring", tpi->choice.btp.destinationPort);
|
||||||
|
|
@ -286,12 +294,19 @@ static int transport_indication(void *responder, void **security_socket, uint8_t
|
||||||
fwd = true;
|
fwd = true;
|
||||||
break;
|
break;
|
||||||
case Port_poi:
|
case Port_poi:
|
||||||
if (facilities.evcsnm_args.activate)
|
if (facilities.evm_args.activate)
|
||||||
{
|
{
|
||||||
evcsnm_check(its_msg);
|
evcsnm_check(its_msg);
|
||||||
}
|
}
|
||||||
fwd = true;
|
fwd = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Port_evrsr:
|
||||||
|
if (facilities.evm_args.activate)
|
||||||
|
{
|
||||||
|
evrsrm_check(its_msg);
|
||||||
|
}
|
||||||
|
fwd = true;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -936,7 +951,7 @@ int main()
|
||||||
}
|
}
|
||||||
|
|
||||||
// EVCSN
|
// EVCSN
|
||||||
if (facilities.evcsnm_args.activate)
|
if (facilities.evm_args.activate)
|
||||||
pthread_create(&facilities.evcsn_service, NULL, evcsn_service, NULL);
|
pthread_create(&facilities.evcsn_service, NULL, evcsn_service, NULL);
|
||||||
|
|
||||||
security_socket = itss_0connect(facilities.zmq.security_address, ZMQ_REQ);
|
security_socket = itss_0connect(facilities.zmq.security_address, ZMQ_REQ);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
#include "saem.h"
|
#include "saem.h"
|
||||||
#include "tpm.h"
|
#include "tpm.h"
|
||||||
#include "vcm.h"
|
#include "vcm.h"
|
||||||
#include "evcsnm.h"
|
#include "evm.h"
|
||||||
|
|
||||||
#include <it2s-tender/epv.h>
|
#include <it2s-tender/epv.h>
|
||||||
#include <it2s-tender/database.h>
|
#include <it2s-tender/database.h>
|
||||||
|
|
@ -73,7 +73,7 @@ typedef struct facilities {
|
||||||
coordination_t coordination;
|
coordination_t coordination;
|
||||||
|
|
||||||
// EVCSN
|
// EVCSN
|
||||||
evcsnm_args_t evcsnm_args;
|
evm_args_t evm_args;
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
struct {
|
struct {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "infrastructure.h"
|
#include "infrastructure.h"
|
||||||
#include "requests.h"
|
#include "requests.h"
|
||||||
#include "cpm.h"
|
#include "cpm.h"
|
||||||
|
#include "evm.h"
|
||||||
|
|
||||||
#include <it2s-asn/itss-facilities/FacilitiesReply.h>
|
#include <it2s-asn/itss-facilities/FacilitiesReply.h>
|
||||||
#include <it2s-asn/itss-transport/TransportRequest.h>
|
#include <it2s-asn/itss-transport/TransportRequest.h>
|
||||||
|
|
@ -108,6 +109,14 @@ int facilities_request_single_message(void* responder, FacilitiesMessageRequest_
|
||||||
bpr->gn.trafficClass = 2;
|
bpr->gn.trafficClass = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ItsMessageType_evrsr:
|
||||||
|
its_msg_def = &asn_DEF_EV_RSR;
|
||||||
|
its_msg = calloc(1, sizeof(EV_RSR_t));
|
||||||
|
bpr->destinationPort = Port_evrsr;
|
||||||
|
bpr->gn.packetTransportType = PacketTransportType_shb;
|
||||||
|
bpr->gn.trafficClass = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log_error("unrecognized FR message type (%lld)", frm->itsMessageType);
|
log_error("unrecognized FR message type (%lld)", frm->itsMessageType);
|
||||||
facilities_request_result_rejected(responder);
|
facilities_request_result_rejected(responder);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue