Syslog efforts

This commit is contained in:
emanuel 2022-03-03 10:22:52 +00:00
parent 1d78616ff8
commit 24b7f11c13
4 changed files with 11 additions and 48 deletions

View File

@ -6,17 +6,7 @@
#include <it2s-tender/time.h>
#include <it2s-tender/space.h>
#define syslog_info(msg, ...) syslog(LOG_INFO, msg, ##__VA_ARGS__)
#define syslog_emerg(msg, ...) syslog(LOG_EMERG, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
#define syslog_err(msg, ...) syslog(LOG_ERR, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
#ifndef NDEBUG
#define syslog_debug(msg, ...) syslog(LOG_DEBUG, "%s:%d " msg "", __func__, __LINE__, ##__VA_ARGS__)
#else
#define syslog_debug(msg, ...)
#endif
#include <it2s-tender/syslog.h>
const cc_ssp_bm_t CC_SSP_BM_MAP[] = {
{"trafficCondition", 1, 0x80000000},

View File

@ -37,16 +37,7 @@
#include <it2s-tender/space.h>
#include <it2s-tender/time.h>
#include <it2s-tender/trajectory.h>
#define syslog_info(msg, ...) syslog(LOG_INFO, msg, ##__VA_ARGS__)
#define syslog_emerg(msg, ...) syslog(LOG_EMERG, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
#define syslog_err(msg, ...) syslog(LOG_ERR, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
#ifndef NDEBUG
#define syslog_debug(msg, ...) syslog(LOG_DEBUG, "%s:%d " msg "", __func__, __LINE__, ##__VA_ARGS__)
#else
#define syslog_debug(msg, ...)
#endif
#include <it2s-tender/syslog.h>
static int transport_indication(facilities_t *facilities, void* responder, void* security_socket, uint8_t *msg, uint32_t msg_len) {
int rv = 0, code = 0;
@ -86,7 +77,7 @@ static int transport_indication(facilities_t *facilities, void* responder, void*
switch (tpi->present) {
case TransportPacketIndication_PR_btp:
id = tpi->choice.btp.id;
syslog_debug("[facilities]<- received TI.packet.btp | id:%ld size:%dB", id, msg_len);
syslog_debug("[facilities]<- TI.packet.btp | id:%ld size:%dB", id, msg_len);
// Parse message
switch (tpi->choice.btp.destinationPort) {
case Port_cam:
@ -245,7 +236,7 @@ static int transport_indication(facilities_t *facilities, void* responder, void*
break;
case TransportPacketIndication_PR_tcp:
id = tpi->choice.tcp.id;
syslog_debug("[facilities]<- received TI.packet.tcp | id:%ld size:%dB", id, msg_len);
syslog_debug("[facilities]<- TI.packet.tcp | id:%ld size:%dB", id, msg_len);
sreq = calloc(1, sizeof(SecurityRequest_t));
sreq->present = SecurityRequest_PR_tlsRecv;
@ -318,7 +309,7 @@ static int transport_indication(facilities_t *facilities, void* responder, void*
break;
case TransportPacketIndication_PR_udp:
id = tpi->choice.udp.id;
syslog_debug("[facilities]<- received TI.packet.udp | id:%ld size:%dB", id, msg_len);
syslog_debug("[facilities]<- TI.packet.udp | id:%ld size:%dB", id, msg_len);
break;
default:
@ -665,23 +656,22 @@ void* tx(void* fc) {
for (int i = 0; i < stream->len; ++i) {
switch (stream->destination[i]) {
case ITSS_TRANSPORT:
syslog_debug("[facilities]-> sending %s to ->[transport] | id:%ld size:%dB",
syslog_debug("[facilities]-> %s ->[transport] | id:%ld size:%dB",
stream->info_msg[i], stream->id[i], stream->packet_len[i]);
zmq_send(transport_socket, stream->packet[i], stream->packet_len[i], 0);
rv = zmq_recv(transport_socket, &code, 1, 0);
if (rv == -1) {
syslog_debug("[facilities]-> timeout sending %s to ->[transport] | id:%ld size:%dB",
syslog_err("[facilities]-> %s ->[transport] | id:%ld size:%dB <TIMEOUT>",
stream->info_msg[i], stream->id[i], stream->packet_len[i]);
}
break;
case ITSS_APPLICATIONS:
syslog_debug("[facilities]-> sending FDI to ->[applications] | size:%dB", stream->packet_len[i]);
syslog_debug("[facilities]-> sending %s to ->[applications] | id:%ld size:%dB",
syslog_debug("[facilities]-> %s ->[applications] | id:%ld size:%dB",
stream->info_msg[i], stream->id[i], stream->packet_len[i]);
zmq_send(applications_socket, stream->packet[i], stream->packet_len[i], 0);
rv = zmq_recv(applications_socket, &code, 1, 0);
if (rv == -1) {
syslog_debug("[facilities]-> timeout sending %s to ->[transport] | id:%ld size:%dB",
syslog_err("[facilities]-> %s ->[applications] | id:%ld size:%dB <TIMEOUT>",
stream->info_msg[i], stream->id[i], stream->packet_len[i]);
}
break;

View File

@ -6,20 +6,11 @@
#include <it2s-tender/space.h>
#include <it2s-tender/time.h>
#include <it2s-tender/syslog.h>
#include <ivim/Pictogram-trafficSign.h>
#include <ivim/Pictogram-conditionsSign.h>
#define syslog_info(msg, ...) syslog(LOG_INFO, msg, ##__VA_ARGS__)
#define syslog_emerg(msg, ...) syslog(LOG_EMERG, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
#define syslog_err(msg, ...) syslog(LOG_ERR, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
#ifndef NDEBUG
#define syslog_debug(msg, ...) syslog(LOG_DEBUG, "%s:%d " msg "", __func__, __LINE__, ##__VA_ARGS__)
#else
#define syslog_debug(msg, ...)
#endif
const ivi_diid_ssp_bm_t DIID_SSP_BM_MAP[] = {
{"Vienna Convention Code for road sign", IVI_DIID_ViennaCodeConvention, 0x800000},
{"ISO 14823 traffic sign pictogram (danger/warning)", IVI_DIID_TrafficSignPictogramDangerWarning, 0x400000},

View File

@ -13,16 +13,8 @@
#include <cpm/CPM.h>
#include <it2s-tender/time.h>
#include <it2s-tender/syslog.h>
#define syslog_info(msg, ...) syslog(LOG_INFO, msg, ##__VA_ARGS__)
#define syslog_emerg(msg, ...) syslog(LOG_EMERG, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
#define syslog_err(msg, ...) syslog(LOG_ERR, "%s:%d [" msg "]", __func__, __LINE__, ##__VA_ARGS__)
#ifndef NDEBUG
#define syslog_debug(msg, ...) syslog(LOG_DEBUG, "%s:%d " msg "", __func__, __LINE__, ##__VA_ARGS__)
#else
#define syslog_debug(msg, ...)
#endif
int facilities_request_result_accepted(void* responder) {
int rv = 0;