automotive-dlt
|
#include <netdb.h>
#include <ctype.h>
#include <stdio.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <syslog.h>
#include <errno.h>
#include <pthread.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "dlt_types.h"
#include "dlt-daemon.h"
#include "dlt-daemon_cfg.h"
#include "dlt_daemon_common_cfg.h"
#include "dlt_daemon_socket.h"
#include "dlt_daemon_serial.h"
#include "dlt_daemon_client.h"
#include "dlt_daemon_connection.h"
#include "dlt_daemon_offline_logstorage.h"
#include "dlt_gateway.h"
Go to the source code of this file.
Macros | |
#define | DLT_CHECK_RCV_DATA_SIZE(received, required) |
Functions | |
static int | dlt_daemon_client_send_all_multiple (DltDaemon *daemon, DltDaemonLocal *daemon_local, void *data1, int size1, void *data2, int size2, int verbose) |
Sends up to 2 messages to all the clients. More... | |
int | dlt_daemon_client_send_all (DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) |
Send out message to all the clients. More... | |
int | dlt_daemon_client_send (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, void *storage_header, int storage_header_size, void *data1, int size1, void *data2, int size2, int verbose) |
int | dlt_daemon_client_send_control_message (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, char *appid, char *ctid, int verbose) |
int | dlt_daemon_client_process_control (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_get_software_version (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) |
void | dlt_daemon_control_get_default_log_level (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) |
void | dlt_daemon_control_get_log_info (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
int | dlt_daemon_control_message_buffer_overflow (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, unsigned int overflow_counter, char *apid, int verbose) |
void | dlt_daemon_control_service_response (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, uint32_t service_id, int8_t status, int verbose) |
int | dlt_daemon_control_message_unregister_context (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, char *apid, char *ctid, char *comid, int verbose) |
int | dlt_daemon_control_message_connection_info (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, uint8_t state, char *comid, int verbose) |
int | dlt_daemon_control_message_timezone (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) |
int | dlt_daemon_control_message_marker (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) |
void | dlt_daemon_control_callsw_cinjection (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_send_log_level (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltDaemonContext *context, int8_t loglevel, int verbose) |
void | dlt_daemon_find_multiple_context_and_send (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int8_t app_flag, char *str, int8_t len, int8_t loglevel, int verbose) |
void | dlt_daemon_control_set_log_level (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_set_trace_status (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_set_default_log_level (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_set_all_log_level (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_set_default_trace_status (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_set_timing_packets (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_message_time (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) |
int | dlt_daemon_process_one_s_timer (DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *receiver, int verbose) |
int | dlt_daemon_process_sixty_s_timer (DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *receiver, int verbose) |
int | dlt_daemon_process_systemd_timer (DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *receiver, int verbose) |
void | dlt_daemon_control_service_logstorage (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_passive_node_connect (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, int verbose) |
void | dlt_daemon_control_passive_node_connect_status (int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose) |
Variables | |
static char | str [DLT_DAEMON_TEXTBUFSIZE] |
Definition in file dlt_daemon_client.c.
#define DLT_CHECK_RCV_DATA_SIZE | ( | received, | |
required | |||
) |
Definition at line 72 of file dlt_daemon_client.c.
Referenced by dlt_daemon_control_get_log_info(), dlt_daemon_control_passive_node_connect(), dlt_daemon_control_service_logstorage(), dlt_daemon_control_set_all_log_level(), dlt_daemon_control_set_default_log_level(), dlt_daemon_control_set_default_trace_status(), dlt_daemon_control_set_log_level(), dlt_daemon_control_set_timing_packets(), and dlt_daemon_control_set_trace_status().
int dlt_daemon_client_process_control | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process received control message from dlt client
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 422 of file dlt_daemon_client.c.
References DltDaemonFlags::contextLogLevel, DltDaemonFlags::contextTraceStatus, sDltMessage::databuffer, sDltMessage::datasize, dlt_daemon_applications_save(), dlt_daemon_contexts_save(), dlt_daemon_control_callsw_cinjection(), dlt_daemon_control_get_default_log_level(), dlt_daemon_control_get_log_info(), dlt_daemon_control_get_software_version(), dlt_daemon_control_message_buffer_overflow(), dlt_daemon_control_passive_node_connect(), dlt_daemon_control_passive_node_connect_status(), dlt_daemon_control_reset_to_factory_default(), dlt_daemon_control_service_logstorage(), dlt_daemon_control_service_response(), dlt_daemon_control_set_all_log_level(), dlt_daemon_control_set_default_log_level(), dlt_daemon_control_set_default_trace_status(), dlt_daemon_control_set_log_level(), dlt_daemon_control_set_timing_packets(), dlt_daemon_control_set_trace_status(), DLT_ENDIAN_GET_32, dlt_gateway_forward_control_message(), DLT_SERVICE_ID_CALLSW_CINJECTION, DLT_SERVICE_ID_GET_DEFAULT_LOG_LEVEL, DLT_SERVICE_ID_GET_LOCAL_TIME, DLT_SERVICE_ID_GET_LOG_INFO, DLT_SERVICE_ID_GET_SOFTWARE_VERSION, DLT_SERVICE_ID_MESSAGE_BUFFER_OVERFLOW, DLT_SERVICE_ID_OFFLINE_LOGSTORAGE, DLT_SERVICE_ID_PASSIVE_NODE_CONNECT, DLT_SERVICE_ID_PASSIVE_NODE_CONNECTION_STATUS, DLT_SERVICE_ID_RESET_TO_FACTORY_DEFAULT, DLT_SERVICE_ID_SET_ALL_LOG_LEVEL, DLT_SERVICE_ID_SET_COM_INTERFACE_MAX_BANDWIDTH, DLT_SERVICE_ID_SET_COM_INTERFACE_STATUS, DLT_SERVICE_ID_SET_DEFAULT_LOG_LEVEL, DLT_SERVICE_ID_SET_DEFAULT_TRACE_STATUS, DLT_SERVICE_ID_SET_LOG_LEVEL, DLT_SERVICE_ID_SET_MESSAGE_FILTERING, DLT_SERVICE_ID_SET_TIMING_PACKETS, DLT_SERVICE_ID_SET_TRACE_STATUS, DLT_SERVICE_ID_SET_VERBOSE_MODE, DLT_SERVICE_ID_STORE_CONFIG, DLT_SERVICE_ID_USE_ECU_ID, DLT_SERVICE_ID_USE_EXTENDED_HEADER, DLT_SERVICE_ID_USE_SESSION_ID, DLT_SERVICE_ID_USE_TIMESTAMP, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_NOT_SUPPORTED, DLT_SERVICE_RESPONSE_OK, DltDaemonFlags::enforceContextLLAndTS, DltDaemonFlags::evalue, DltDaemonLocal::flags, DltDaemonFlags::gatewayMode, sDltMessage::headerextra, NULL, DltDaemon::overflow_counter, DltDaemonLocal::pGateway, PRINT_FUNCTION_VERBOSE, DltDaemon::runtime_application_cfg, DltDaemon::runtime_context_cfg, and sDltMessage::standardheader.
Referenced by dlt_daemon_process_client_messages(), dlt_daemon_process_client_messages_serial(), and dlt_daemon_process_control_messages().
int dlt_daemon_client_send | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
void * | storage_header, | ||
int | storage_header_size, | ||
void * | data1, | ||
int | size1, | ||
void * | data2, | ||
int | size2, | ||
int | verbose | ||
) |
Send out message to client or store message in offline trace.
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
storage_header | pointer to data |
storage_header_size | size of data |
data1 | pointer to data |
size1 | size of data |
data2 | pointer to data |
size2 | size of data |
verbose | if set to true verbose information is printed out. |
Definition at line 225 of file dlt_daemon_client.c.
References DltDaemon::client_ringbuffer, dlt_buffer_push3(), dlt_daemon_change_state(), dlt_daemon_client_send_all_multiple(), DLT_DAEMON_ERROR_BUFFER_FULL, DLT_DAEMON_ERROR_OK, DLT_DAEMON_ERROR_SEND_FAILED, dlt_daemon_logstorage_write(), DLT_DAEMON_SEM_FREE, DLT_DAEMON_SEM_LOCK, DLT_DAEMON_SEND_FORCE, DLT_DAEMON_SEND_TO_ALL, dlt_daemon_serial_send(), dlt_daemon_socket_send(), DLT_DAEMON_STATE_BUFFER, DLT_DAEMON_STATE_BUFFER_FULL, DLT_DAEMON_STATE_SEND_BUFFER, DLT_DAEMON_STATE_SEND_DIRECT, dlt_log(), dlt_offline_trace_write(), DLT_RETURN_OK, DLT_USER_MODE_BOTH, DLT_USER_MODE_EXTERNAL, DLT_USER_MODE_INTERNAL, DltDaemonLocal::flags, DltDaemon::mode, DltDaemonFlags::offlineLogstorageMaxDevices, DltDaemonLocal::offlineTrace, DltDaemonFlags::offlineTraceDirectory, DltDaemon::sendserialheader, and DltDaemon::state.
Referenced by dlt_daemon_client_send_control_message(), dlt_daemon_control_message_time(), dlt_daemon_log_internal(), dlt_daemon_process_user_message_log(), dlt_daemon_send_ringbuffer_to_client(), and dlt_gateway_process_passive_node_messages().
int dlt_daemon_client_send_all | ( | DltDaemon * | daemon, |
DltDaemonLocal * | daemon_local, | ||
int | verbose | ||
) |
Send out message to all the clients.
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
verbose | if set to true verbose information is printed out. |
Definition at line 185 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, dlt_daemon_client_send_all_multiple(), DLT_DAEMON_SEM_FREE, DLT_DAEMON_SEM_LOCK, DLT_DAEMON_TEXTBUFSIZE, dlt_log(), sDltMessage::headerbuffer, sDltMessage::headersize, DltDaemonLocal::msg, and NULL.
Referenced by dlt_daemon_process_user_message_log().
|
static |
Sends up to 2 messages to all the clients.
Runs through the client list and sends the messages to them. If the message transfer fails and the connection is a socket connection, the socket is closed. Takes and release dlt_daemon_mutex.
daemon | Daemon structure needed for socket closure. |
daemon_local | Daemon local structure |
data1 | The first message to be sent. |
size1 | The size of the first message. |
data2 | The second message to be send. |
size2 | The second message size. |
verbose | Needed for socket closure. |
Definition at line 101 of file dlt_daemon_client.c.
References DltDaemonLocal::client_connections, DltEventHandler::connections, DLT_CON_MASK_CLIENT_MSG_SERIAL, DLT_CON_MASK_CLIENT_MSG_TCP, DLT_CONNECTION_CLIENT_MSG_TCP, dlt_connection_get_next(), dlt_connection_send_multiple(), dlt_daemon_close_socket(), DLT_DAEMON_ERROR_OK, DLT_DAEMON_SEM_FREE, DLT_DAEMON_SEM_LOCK, DLT_DAEMON_TEXTBUFSIZE, dlt_log(), DltReceiver::fd, DltConnection::next, NULL, DltDaemonLocal::pEvent, DltConnection::receiver, DltDaemon::sendserialheader, and DltConnection::type.
Referenced by dlt_daemon_client_send(), and dlt_daemon_client_send_all().
int dlt_daemon_client_send_control_message | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
char * | appid, | ||
char * | contid, | ||
int | verbose | ||
) |
Send out response message to dlt client
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to response message |
appid | pointer to application id to be used in response message |
contid | pointer to context id to be used in response message |
verbose | if set to true verbose information is printed out. |
Definition at line 339 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, dlt_daemon_client_send(), DLT_DAEMON_CTRL_APID, DLT_DAEMON_CTRL_CTID, DLT_DAEMON_ERROR_OK, DLT_DAEMON_ERROR_UNKNOWN, DLT_HTOBE_16, DLT_HTYP_MSBF, DLT_HTYP_PROTOCOL_VERSION1, DLT_HTYP_UEH, DLT_HTYP_WEID, DLT_HTYP_WTMS, dlt_log(), dlt_message_set_extraparameters(), DLT_MSIN_CONTROL_RESPONSE, DLT_RETURN_ERROR, dlt_set_id(), dlt_set_storageheader(), DLT_STANDARD_HEADER_EXTRA_SIZE, dlt_uptime(), DltDaemon::ecuid, sDltMessage::extendedheader, sDltMessage::headerbuffer, sDltMessage::headerextra, sDltMessage::headersize, PRINT_FUNCTION_VERBOSE, sDltMessage::standardheader, and sDltMessage::storageheader.
Referenced by dlt_daemon_control_get_default_log_level(), dlt_daemon_control_get_log_info(), dlt_daemon_control_get_software_version(), dlt_daemon_control_message_buffer_overflow(), dlt_daemon_control_message_connection_info(), dlt_daemon_control_message_marker(), dlt_daemon_control_message_timezone(), dlt_daemon_control_message_unregister_context(), dlt_daemon_control_passive_node_connect_status(), and dlt_daemon_control_service_response().
void dlt_daemon_control_callsw_cinjection | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to received sw injection control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received sw injection control message |
verbose | if set to true verbose information is printed out. |
Definition at line 1425 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_context_find(), dlt_daemon_control_service_response(), DLT_DAEMON_INJECTION_MAX, DLT_DAEMON_INJECTION_MIN, DLT_ENDIAN_GET_32, DLT_FD_INIT, DLT_ID_SIZE, DLT_IS_HTYP_UEH, DLT_MSG_READ_VALUE, DLT_RETURN_OK, DLT_RETURN_PIPE_ERROR, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_NOT_SUPPORTED, DLT_SERVICE_RESPONSE_OK, dlt_set_id(), dlt_user_log_out3(), DLT_USER_MESSAGE_INJECTION, dlt_user_set_userheader(), sDltMessage::extendedheader, DltDaemonContext::log_level_pos, NULL, PRINT_FUNCTION_VERBOSE, sDltMessage::standardheader, and DltDaemonContext::user_handle.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_get_default_log_level | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
int | verbose | ||
) |
Process and generate response to received get default log level control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
verbose | if set to true verbose information is printed out. |
Definition at line 674 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, DltDaemon::default_log_level, dlt_daemon_client_send_control_message(), dlt_daemon_control_service_response(), dlt_message_free(), dlt_message_init(), DLT_RETURN_ERROR, DLT_SERVICE_ID_GET_DEFAULT_LOG_LEVEL, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_get_log_info | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to received get log info control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 721 of file dlt_daemon_client.c.
References DltDaemonApplication::apid, DltDaemonApplication::application_description, DltDaemon::applications, DltDaemonContext::context_description, DltDaemon::contexts, DltDaemonContext::ctid, sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_application_find(), dlt_daemon_client_send_control_message(), dlt_daemon_context_find(), dlt_daemon_control_service_response(), DLT_DAEMON_REMO_STRING, DLT_DAEMON_TEXTBUFSIZE, DLT_ID_SIZE, dlt_log(), dlt_message_free(), dlt_message_init(), dlt_print_id(), DLT_RETURN_ERROR, DLT_SERVICE_ID_GET_LOG_INFO, DLT_SERVICE_RESPONSE_ERROR, dlt_set_id(), DltDaemonContext::log_level, NULL, DltDaemon::num_applications, DltDaemonApplication::num_contexts, DltDaemon::num_contexts, PRINT_FUNCTION_VERBOSE, str, and DltDaemonContext::trace_status.
Referenced by dlt_daemon_client_process_control(), and dlt_daemon_process_user_message_register_context().
void dlt_daemon_control_get_software_version | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
int | verbose | ||
) |
Process and generate response to received get software version control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
verbose | if set to true verbose information is printed out. |
Definition at line 622 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_client_send_control_message(), dlt_daemon_control_service_response(), dlt_message_free(), dlt_message_init(), DLT_RETURN_ERROR, DLT_SERVICE_ID_GET_SOFTWARE_VERSION, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, DltDaemon::ECUVersionString, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control(), dlt_daemon_process_client_connect(), and dlt_daemon_process_sixty_s_timer().
int dlt_daemon_control_message_buffer_overflow | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
unsigned int | overflow_counter, | ||
char * | apid, | ||
int | verbose | ||
) |
Process and generate response to message buffer overflow control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
verbose | if set to true verbose information is printed out. |
Definition at line 1108 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_client_send_control_message(), dlt_daemon_control_service_response(), DLT_DAEMON_ERROR_OK, DLT_DAEMON_ERROR_UNKNOWN, DLT_MESSAGE_BUFFER_OVERFLOW, dlt_message_free(), dlt_message_init(), DLT_RETURN_ERROR, DLT_SERVICE_ID_MESSAGE_BUFFER_OVERFLOW, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control(), dlt_daemon_process_user_message_overflow(), and dlt_daemon_send_message_overflow().
int dlt_daemon_control_message_connection_info | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
uint8_t | state, | ||
char * | comid, | ||
int | verbose | ||
) |
Send control message connection info (add on to AUTOSAR standard)
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
state | state of connection |
comid | Communication id where connection state changed |
verbose | if set to true verbose information is printed out. |
Definition at line 1262 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_client_send_control_message(), dlt_message_free(), dlt_message_init(), DLT_RETURN_ERROR, DLT_SERVICE_ID_CONNECTION_INFO, DLT_SERVICE_RESPONSE_OK, dlt_set_id(), and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_close_socket(), and dlt_daemon_process_client_connect().
int dlt_daemon_control_message_marker | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
int | verbose | ||
) |
Send control message marker (add on to AUTOSAR standard)
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
verbose | if set to true verbose information is printed out. |
Definition at line 1374 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_client_send_control_message(), dlt_message_free(), dlt_message_init(), DLT_RETURN_ERROR, DLT_SERVICE_ID_MARKER, DLT_SERVICE_RESPONSE_OK, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_process_user_message_marker().
void dlt_daemon_control_message_time | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
int | verbose | ||
) |
Send time control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
verbose | if set to true verbose information is printed out. |
Definition at line 1865 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, dlt_daemon_client_send(), DLT_HTOBE_16, DLT_HTYP_MSBF, DLT_HTYP_PROTOCOL_VERSION1, DLT_HTYP_UEH, DLT_HTYP_WEID, DLT_HTYP_WTMS, dlt_log(), dlt_message_free(), dlt_message_init(), dlt_message_set_extraparameters(), DLT_MSIN_CONTROL_TIME, DLT_RETURN_ERROR, dlt_set_id(), dlt_set_storageheader(), DLT_STANDARD_HEADER_EXTRA_SIZE, dlt_uptime(), DltDaemon::ecuid, sDltMessage::extendedheader, sDltMessage::headerbuffer, sDltMessage::headerextra, sDltMessage::headersize, PRINT_FUNCTION_VERBOSE, sDltMessage::standardheader, and sDltMessage::storageheader.
Referenced by dlt_daemon_process_one_s_timer().
int dlt_daemon_control_message_timezone | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
int | verbose | ||
) |
Send control message timezone (add on to AUTOSAR standard)
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
verbose | if set to true verbose information is printed out. |
Definition at line 1315 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_client_send_control_message(), dlt_message_free(), dlt_message_init(), DLT_RETURN_ERROR, DLT_SERVICE_ID_TIMEZONE, DLT_SERVICE_RESPONSE_OK, NULL, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_process_client_connect(), and dlt_daemon_process_sixty_s_timer().
int dlt_daemon_control_message_unregister_context | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
char * | apid, | ||
char * | ctid, | ||
char * | comid, | ||
int | verbose | ||
) |
Send control message unregister context (add on to AUTOSAR standard)
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
apid | application id to be unregisteres |
ctid | context id to be unregistered |
comid | Communication id where apid is unregistered |
verbose | if set to true verbose information is printed out. |
Definition at line 1208 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_client_send_control_message(), dlt_message_free(), dlt_message_init(), DLT_RETURN_ERROR, DLT_SERVICE_ID_UNREGISTER_CONTEXT, DLT_SERVICE_RESPONSE_OK, dlt_set_id(), and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_process_user_message_unregister_context().
void dlt_daemon_control_passive_node_connect | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to received passive node connect control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 2249 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_control_service_response(), dlt_gateway_process_on_demand_request(), dlt_log(), DLT_SERVICE_ID_PASSIVE_NODE_CONNECT, DLT_SERVICE_ID_PASSIVE_NODE_CONNECTION_STATUS, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, DltDaemonLocal::flags, DltDaemonFlags::gatewayMode, NULL, DltDaemonLocal::pGateway, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_passive_node_connect_status | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
int | verbose | ||
) |
Process and generate response to received passive node connection status control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
verbose | if set to true verbose information is printed out. |
Definition at line 2315 of file dlt_daemon_client.c.
References DltGateway::connections, sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_client_send_control_message(), dlt_daemon_control_service_response(), DLT_ENTRY_MAX, DLT_ID_SIZE, dlt_log(), dlt_message_free(), dlt_message_init(), DLT_SERVICE_ID_PASSIVE_NODE_CONNECTION_STATUS, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, DltGatewayConnection::ecuid, DltDaemonLocal::flags, DltDaemonFlags::gatewayMode, NULL, DltGateway::num_connections, DltDaemonLocal::pGateway, PRINT_FUNCTION_VERBOSE, and DltGatewayConnection::status.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_service_logstorage | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Service offline logstorage command request
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 2123 of file dlt_daemon_client.c.
References DltLogStorage::connection_type, sDltMessage::databuffer, sDltMessage::datasize, DltLogStorage::device_mount_point, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_control_service_response(), dlt_daemon_logstorage_reset_application_loglevel(), dlt_daemon_logstorage_sync_cache(), dlt_daemon_logstorage_update_application_loglevel(), dlt_log(), dlt_logstorage_device_connected(), dlt_logstorage_device_disconnected(), dlt_logstorage_load_config(), DLT_LOGSTORAGE_SYNC_ON_DEVICE_DISCONNECT, DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED, DLT_OFFLINE_LOGSTORAGE_DEVICE_DISCONNECTED, DLT_OFFLINE_LOGSTORAGE_SYNC_CACHES, DLT_SERVICE_ID_OFFLINE_LOGSTORAGE, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, DltDaemonLocal::flags, NULL, DltDaemonFlags::offlineLogstorageMaxDevices, PRINT_FUNCTION_VERBOSE, and DltDaemon::storage_handle.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_service_response | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
uint32_t | service_id, | ||
int8_t | status, | ||
int | verbose | ||
) |
Generate response to control message from dlt client
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
service_id | service id of control message |
status | status of response (e.g. ok, not supported, error) |
verbose | if set to true verbose information is printed out. |
Definition at line 1163 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::databuffersize, sDltMessage::datasize, dlt_daemon_client_send_control_message(), dlt_message_free(), dlt_message_init(), DLT_RETURN_ERROR, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control(), dlt_daemon_control_callsw_cinjection(), dlt_daemon_control_get_default_log_level(), dlt_daemon_control_get_log_info(), dlt_daemon_control_get_software_version(), dlt_daemon_control_message_buffer_overflow(), dlt_daemon_control_passive_node_connect(), dlt_daemon_control_passive_node_connect_status(), dlt_daemon_control_service_logstorage(), dlt_daemon_control_set_all_log_level(), dlt_daemon_control_set_default_log_level(), dlt_daemon_control_set_default_trace_status(), dlt_daemon_control_set_log_level(), dlt_daemon_control_set_timing_packets(), dlt_daemon_control_set_trace_status(), and dlt_daemon_send_log_level().
void dlt_daemon_control_set_all_log_level | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to received set all log level control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 1763 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_control_service_response(), dlt_daemon_user_send_all_update(), DLT_LOG_VERBOSE, DLT_SERVICE_ID_SET_ALL_LOG_LEVEL, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, NULL, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_set_default_log_level | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to received set default log level control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 1727 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, DltDaemon::default_log_level, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_control_service_response(), dlt_daemon_user_send_default_update(), DLT_LOG_VERBOSE, DLT_SERVICE_ID_SET_DEFAULT_LOG_LEVEL, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, NULL, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_set_default_trace_status | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to received set default trace status control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 1798 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, DltDaemon::default_trace_status, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_control_service_response(), dlt_daemon_user_send_default_update(), DLT_SERVICE_ID_SET_DEFAULT_TRACE_STATUS, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, DLT_TRACE_STATUS_OFF, DLT_TRACE_STATUS_ON, NULL, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_set_log_level | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to received set log level control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 1614 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_context_find(), dlt_daemon_control_service_response(), dlt_daemon_find_multiple_context_and_send(), dlt_daemon_send_log_level(), DLT_ID_SIZE, dlt_log(), DLT_SERVICE_ID_SET_LOG_LEVEL, DLT_SERVICE_RESPONSE_ERROR, dlt_set_id(), DltDaemonContext::log_level, NULL, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_set_timing_packets | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to set timing packets control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 1835 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_control_service_response(), DLT_SERVICE_ID_SET_TIMING_PACKETS, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, NULL, PRINT_FUNCTION_VERBOSE, and DltDaemon::timingpackets.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_control_set_trace_status | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltMessage * | msg, | ||
int | verbose | ||
) |
Process and generate response to received set trace status control message
sock | connection handle used for sending response |
daemon | pointer to dlt daemon structure |
daemon_local | pointer to dlt daemon local structure |
msg | pointer to received control message |
verbose | if set to true verbose information is printed out. |
Definition at line 1674 of file dlt_daemon_client.c.
References sDltMessage::databuffer, sDltMessage::datasize, DLT_CHECK_RCV_DATA_SIZE, dlt_daemon_context_find(), dlt_daemon_control_service_response(), dlt_daemon_user_send_log_level(), DLT_FD_MINIMUM, DLT_ID_SIZE, DLT_SERVICE_ID_SET_TRACE_STATUS, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, dlt_set_id(), NULL, PRINT_FUNCTION_VERBOSE, DltDaemonContext::trace_status, and DltDaemonContext::user_handle.
Referenced by dlt_daemon_client_process_control().
void dlt_daemon_find_multiple_context_and_send | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
int8_t | app_flag, | ||
char * | str, | ||
int8_t | len, | ||
int8_t | loglevel, | ||
int | verbose | ||
) |
Definition at line 1569 of file dlt_daemon_client.c.
References DltDaemonContext::apid, DltDaemon::contexts, DltDaemonContext::ctid, dlt_daemon_send_log_level(), DLT_ID_SIZE, NULL, DltDaemon::num_contexts, and PRINT_FUNCTION_VERBOSE.
Referenced by dlt_daemon_control_set_log_level().
int dlt_daemon_process_one_s_timer | ( | DltDaemon * | daemon, |
DltDaemonLocal * | daemon_local, | ||
DltReceiver * | receiver, | ||
int | verbose | ||
) |
Definition at line 1941 of file dlt_daemon_client.c.
References dlt_daemon_control_message_time(), dlt_daemon_send_ringbuffer_to_client(), DLT_DAEMON_SEND_TO_ALL, DLT_DAEMON_STATE_BUFFER_FULL, DLT_DAEMON_STATE_SEND_BUFFER, DLT_DAEMON_STATE_SEND_DIRECT, DLT_DAEMON_TEXTBUFSIZE, dlt_log(), DltReceiver::fd, DltDaemonLocal::flags, NULL, PRINT_FUNCTION_VERBOSE, DltDaemon::state, str, DltDaemon::timingpackets, and DltDaemonFlags::vflag.
Referenced by dlt_connection_get_callback().
int dlt_daemon_process_sixty_s_timer | ( | DltDaemon * | daemon, |
DltDaemonLocal * | daemon_local, | ||
DltReceiver * | receiver, | ||
int | verbose | ||
) |
Definition at line 2000 of file dlt_daemon_client.c.
References dlt_daemon_control_get_software_version(), dlt_daemon_control_message_timezone(), dlt_daemon_process_systemd_timer(), DLT_DAEMON_SEND_TO_ALL, DLT_DAEMON_TEXTBUFSIZE, dlt_log(), DltReceiver::fd, DltDaemonLocal::flags, NULL, PRINT_FUNCTION_VERBOSE, DltDaemonFlags::sendECUSoftwareVersion, DltDaemonFlags::sendTimezone, str, and DltDaemonFlags::vflag.
Referenced by dlt_connection_get_callback().
int dlt_daemon_process_systemd_timer | ( | DltDaemon * | daemon, |
DltDaemonLocal * | daemon_local, | ||
DltReceiver * | receiver, | ||
int | verbose | ||
) |
Definition at line 2107 of file dlt_daemon_client.c.
References dlt_log().
Referenced by dlt_connection_get_callback(), and dlt_daemon_process_sixty_s_timer().
void dlt_daemon_send_log_level | ( | int | sock, |
DltDaemon * | daemon, | ||
DltDaemonLocal * | daemon_local, | ||
DltDaemonContext * | context, | ||
int8_t | loglevel, | ||
int | verbose | ||
) |
Definition at line 1545 of file dlt_daemon_client.c.
References dlt_daemon_control_service_response(), dlt_daemon_user_send_log_level(), DLT_FD_MINIMUM, dlt_log(), DLT_SERVICE_ID_SET_LOG_LEVEL, DLT_SERVICE_RESPONSE_ERROR, DLT_SERVICE_RESPONSE_OK, DltDaemonContext::log_level, PRINT_FUNCTION_VERBOSE, and DltDaemonContext::user_handle.
Referenced by dlt_daemon_control_set_log_level(), and dlt_daemon_find_multiple_context_and_send().
|
static |
Global text output buffer, mainly used for creation of error/warning strings
Definition at line 83 of file dlt_daemon_client.c.
Referenced by dlt_daemon_control_get_log_info(), dlt_daemon_process_one_s_timer(), and dlt_daemon_process_sixty_s_timer().