automotive-dlt
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <inttypes.h>
#include <stdarg.h>
#include <errno.h>
#include <sys/stat.h>
#include "dlt_user_shared.h"
#include "dlt_common.h"
#include "dlt_common_cfg.h"
#include "dlt_version.h"
#include <sys/socket.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/time.h>
Go to the source code of this file.
Functions | |
int | dlt_buffer_get (DltBuffer *buf, unsigned char *data, int max_size, int delete) |
int | dlt_buffer_reset (DltBuffer *buf) |
int | dlt_buffer_increase_size (DltBuffer *buf) |
int | dlt_buffer_minimize_size (DltBuffer *buf) |
void | dlt_buffer_write_block (DltBuffer *buf, int *write, const unsigned char *data, unsigned int size) |
void | dlt_buffer_read_block (DltBuffer *buf, int *read, unsigned char *data, unsigned int size) |
void | dlt_print_hex (uint8_t *ptr, int size) |
DltReturnValue | dlt_print_hex_string (char *text, int textlength, uint8_t *ptr, int size) |
DltReturnValue | dlt_print_mixed_string (char *text, int textlength, uint8_t *ptr, int size, int html) |
DltReturnValue | dlt_print_char_string (char **text, int textlength, uint8_t *ptr, int size) |
void | dlt_print_id (char *text, const char *id) |
void | dlt_set_id (char *id, const char *text) |
void | dlt_clean_string (char *text, int length) |
DltReturnValue | dlt_filter_init (DltFilter *filter, int verbose) |
DltReturnValue | dlt_filter_free (DltFilter *filter, int verbose) |
DltReturnValue | dlt_filter_load (DltFilter *filter, const char *filename, int verbose) |
DltReturnValue | dlt_filter_save (DltFilter *filter, const char *filename, int verbose) |
int | dlt_filter_find (DltFilter *filter, const char *apid, const char *ctid, int verbose) |
DltReturnValue | dlt_filter_add (DltFilter *filter, const char *apid, const char *ctid, int verbose) |
DltReturnValue | dlt_filter_delete (DltFilter *filter, const char *apid, const char *ctid, int verbose) |
DltReturnValue | dlt_message_init (DltMessage *msg, int verbose) |
DltReturnValue | dlt_message_free (DltMessage *msg, int verbose) |
DltReturnValue | dlt_message_header (DltMessage *msg, char *text, int textlength, int verbose) |
DltReturnValue | dlt_message_header_flags (DltMessage *msg, char *text, int textlength, int flags, int verbose) |
DltReturnValue | dlt_message_payload (DltMessage *msg, char *text, int textlength, int type, int verbose) |
DltReturnValue | dlt_message_filter_check (DltMessage *msg, DltFilter *filter, int verbose) |
int | dlt_message_read (DltMessage *msg, uint8_t *buffer, unsigned int length, int resync, int verbose) |
DltReturnValue | dlt_message_get_extraparameters (DltMessage *msg, int verbose) |
DltReturnValue | dlt_message_set_extraparameters (DltMessage *msg, int verbose) |
DltReturnValue | dlt_file_init (DltFile *file, int verbose) |
DltReturnValue | dlt_file_set_filter (DltFile *file, DltFilter *filter, int verbose) |
DltReturnValue | dlt_file_read_header (DltFile *file, int verbose) |
DltReturnValue | dlt_file_read_header_raw (DltFile *file, int resync, int verbose) |
DltReturnValue | dlt_file_read_header_extended (DltFile *file, int verbose) |
DltReturnValue | dlt_file_read_data (DltFile *file, int verbose) |
DltReturnValue | dlt_file_open (DltFile *file, const char *filename, int verbose) |
DltReturnValue | dlt_file_read (DltFile *file, int verbose) |
DltReturnValue | dlt_file_read_raw (DltFile *file, int resync, int verbose) |
DltReturnValue | dlt_file_close (DltFile *file, int verbose) |
DltReturnValue | dlt_file_message (DltFile *file, int index, int verbose) |
DltReturnValue | dlt_file_free (DltFile *file, int verbose) |
void | dlt_log_set_level (int level) |
void | dlt_log_set_filename (const char *filename) |
void | dlt_log_set_fifo_basedir (const char *env_pipe_dir) |
void | dlt_log_init (int mode) |
void | dlt_log_free (void) |
DltReturnValue | dlt_log (int prio, char *s) |
DltReturnValue | dlt_vlog (int prio, const char *format,...) |
DltReturnValue | dlt_vnlog (int prio, size_t size, const char *format,...) |
DltReturnValue | dlt_receiver_init (DltReceiver *receiver, int fd, int buffersize) |
DltReturnValue | dlt_receiver_free (DltReceiver *receiver) |
int | dlt_receiver_receive_socket (DltReceiver *receiver) |
int | dlt_receiver_receive_fd (DltReceiver *receiver) |
DltReturnValue | dlt_receiver_remove (DltReceiver *receiver, int size) |
DltReturnValue | dlt_receiver_move_to_begin (DltReceiver *receiver) |
int | dlt_receiver_check_and_get (DltReceiver *receiver, void *dest, unsigned int to_get, unsigned int flags) |
DltReturnValue | dlt_set_storageheader (DltStorageHeader *storageheader, const char *ecu) |
DltReturnValue | dlt_check_storageheader (DltStorageHeader *storageheader) |
DltReturnValue | dlt_buffer_init_static_server (DltBuffer *buf, const unsigned char *ptr, uint32_t size) |
DltReturnValue | dlt_buffer_init_static_client (DltBuffer *buf, const unsigned char *ptr, uint32_t size) |
DltReturnValue | dlt_buffer_init_dynamic (DltBuffer *buf, uint32_t min_size, uint32_t max_size, uint32_t step_size) |
DltReturnValue | dlt_buffer_free_static (DltBuffer *buf) |
DltReturnValue | dlt_buffer_free_dynamic (DltBuffer *buf) |
DltReturnValue | dlt_buffer_push (DltBuffer *buf, const unsigned char *data, unsigned int size) |
int | dlt_buffer_push3 (DltBuffer *buf, const unsigned char *data1, unsigned int size1, const unsigned char *data2, unsigned int size2, const unsigned char *data3, unsigned int size3) |
int | dlt_buffer_pull (DltBuffer *buf, unsigned char *data, int max_size) |
int | dlt_buffer_copy (DltBuffer *buf, unsigned char *data, int max_size) |
int | dlt_buffer_remove (DltBuffer *buf) |
void | dlt_buffer_info (DltBuffer *buf) |
void | dlt_buffer_status (DltBuffer *buf) |
uint32_t | dlt_buffer_get_total_size (DltBuffer *buf) |
int | dlt_buffer_get_used_size (DltBuffer *buf) |
int | dlt_buffer_get_message_count (DltBuffer *buf) |
DltReturnValue | dlt_setup_serial (int fd, speed_t speed) |
speed_t | dlt_convert_serial_speed (int baudrate) |
void | dlt_get_version (char *buf, size_t size) |
void | dlt_get_major_version (char *buf, size_t size) |
void | dlt_get_minor_version (char *buf, size_t size) |
uint32_t | dlt_uptime (void) |
DltReturnValue | dlt_message_print_header (DltMessage *message, char *text, uint32_t size, int verbose) |
DltReturnValue | dlt_message_print_hex (DltMessage *message, char *text, uint32_t size, int verbose) |
DltReturnValue | dlt_message_print_ascii (DltMessage *message, char *text, uint32_t size, int verbose) |
DltReturnValue | dlt_message_print_mixed_plain (DltMessage *message, char *text, uint32_t size, int verbose) |
DltReturnValue | dlt_message_print_mixed_html (DltMessage *message, char *text, uint32_t size, int verbose) |
DltReturnValue | dlt_message_argument_print (DltMessage *msg, uint32_t type_info, uint8_t **ptr, int32_t *datalength, char *text, int textlength, int byteLength, int __attribute__((unused)) verbose) |
void | dlt_check_envvar () |
int | dlt_mkdir_recursive (const char *dir) |
Variables | |
static char | str [DLT_COMMON_BUFFER_LENGTH] |
const char | dltSerialHeader [DLT_ID_SIZE] = { 'D','L','S',1 } |
char | dltSerialHeaderChar [DLT_ID_SIZE] = { 'D','L','S',1 } |
char | dltFifoBaseDir [PATH_MAX+1] = "/tmp" |
static int | logging_mode = DLT_LOG_TO_CONSOLE |
static int | logging_level = LOG_INFO |
static char | logging_filename [NAME_MAX+1] = "" |
static FILE * | logging_handle = NULL |
char * | message_type [] = {"log","app_trace","nw_trace","control","","","",""} |
char * | log_info [] = {"","fatal","error","warn","info","debug","verbose","","","","","","","","",""} |
char * | trace_type [] = {"","variable","func_in","func_out","state","vfb","","","","","","","","","",""} |
char * | nw_trace_type [] = {"","ipc","can","flexray","most","vfb","","","","","","","","","",""} |
char * | control_type [] = {"","request","response","time","","","","","","","","","","","",""} |
static char * | service_id [] |
static char * | return_type [] = {"ok","not_supported","error","","","","","","no_matching_context_id"} |
Definition in file dlt_common.c.
int dlt_buffer_get | ( | DltBuffer * | buf, |
unsigned char * | data, | ||
int | max_size, | ||
int | delete | ||
) |
Definition at line 2768 of file dlt_common.c.
References DLT_BUFFER_HEAD, dlt_buffer_minimize_size(), dlt_buffer_read_block(), dlt_buffer_reset(), dlt_log(), DltBufferBlockHead::head, NULL, DltBuffer::shm, DltBuffer::size, DltBufferBlockHead::size, and DltBufferBlockHead::status.
Referenced by dlt_buffer_copy(), dlt_buffer_pull(), and dlt_buffer_remove().
int dlt_buffer_increase_size | ( | DltBuffer * | buf | ) |
Definition at line 2557 of file dlt_common.c.
References DltBufferHead::count, dlt_log(), DltBuffer::max_size, DltBuffer::mem, DltBuffer::min_size, NULL, DltBufferHead::read, DltBuffer::shm, DltBuffer::size, DltBuffer::step_size, str, and DltBufferHead::write.
Referenced by dlt_buffer_push3().
int dlt_buffer_minimize_size | ( | DltBuffer * | buf | ) |
Definition at line 2618 of file dlt_common.c.
References dlt_log(), DltBuffer::mem, DltBuffer::min_size, NULL, DltBuffer::shm, DltBuffer::size, and str.
Referenced by dlt_buffer_get().
void dlt_buffer_read_block | ( | DltBuffer * | buf, |
int * | read, | ||
unsigned char * | data, | ||
unsigned int | size | ||
) |
Definition at line 2535 of file dlt_common.c.
References dlt_log(), DltBuffer::mem, NULL, and DltBuffer::size.
Referenced by dlt_buffer_get().
int dlt_buffer_reset | ( | DltBuffer * | buf | ) |
Definition at line 2664 of file dlt_common.c.
References dlt_log(), DltBuffer::mem, NULL, DltBuffer::shm, and DltBuffer::size.
Referenced by dlt_buffer_get(), and dlt_buffer_push3().
void dlt_buffer_write_block | ( | DltBuffer * | buf, |
int * | write, | ||
const unsigned char * | data, | ||
unsigned int | size | ||
) |
Definition at line 2513 of file dlt_common.c.
References dlt_log(), DltBuffer::mem, NULL, and DltBuffer::size.
Referenced by dlt_buffer_push3().
void dlt_log_set_fifo_basedir | ( | const char * | env_pipe_dir | ) |
Definition at line 1994 of file dlt_common.c.
References dltFifoBaseDir.
Referenced by dlt_check_envvar().
DltReturnValue dlt_message_argument_print | ( | DltMessage * | msg, |
uint32_t | type_info, | ||
uint8_t ** | ptr, | ||
int32_t * | datalength, | ||
char * | text, | ||
int | textlength, | ||
int | byteLength, | ||
int __attribute__((unused)) | verbose | ||
) |
Definition at line 3370 of file dlt_common.c.
References DLT_ENDIAN_GET_16, DLT_ENDIAN_GET_32, DLT_ENDIAN_GET_64, dlt_log(), DLT_MSG_READ_STRING, DLT_MSG_READ_VALUE, dlt_print_hex_string(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_WRONG_PARAMETER, DLT_SCOD_ASCII, DLT_SCOD_BIN, DLT_SCOD_HEX, DLT_SCOD_UTF8, DLT_TYLE_128BIT, DLT_TYLE_16BIT, DLT_TYLE_32BIT, DLT_TYLE_64BIT, DLT_TYLE_8BIT, DLT_TYPE_INFO_BOOL, DLT_TYPE_INFO_FIXP, DLT_TYPE_INFO_FLOA, DLT_TYPE_INFO_RAWD, DLT_TYPE_INFO_SCOD, DLT_TYPE_INFO_SINT, DLT_TYPE_INFO_STRG, DLT_TYPE_INFO_TRAI, DLT_TYPE_INFO_TYLE, DLT_TYPE_INFO_UINT, DLT_TYPE_INFO_VARI, NULL, and sDltMessage::standardheader.
Referenced by dlt_message_payload().
char* control_type[] = {"","request","response","time","","","","","","","","","","","",""} |
Definition at line 84 of file dlt_common.c.
Referenced by dlt_message_header_flags().
char* log_info[] = {"","fatal","error","warn","info","debug","verbose","","","","","","","","",""} |
Definition at line 81 of file dlt_common.c.
Referenced by dlt_message_header_flags().
|
static |
Definition at line 77 of file dlt_common.c.
Referenced by dlt_log_init(), and dlt_log_set_filename().
|
static |
Definition at line 78 of file dlt_common.c.
Referenced by dlt_log(), dlt_log_free(), and dlt_log_init().
|
static |
Definition at line 76 of file dlt_common.c.
Referenced by dlt_log(), dlt_log_set_level(), dlt_vlog(), and dlt_vnlog().
|
static |
Definition at line 75 of file dlt_common.c.
Referenced by dlt_log(), dlt_log_free(), and dlt_log_init().
char* message_type[] = {"log","app_trace","nw_trace","control","","","",""} |
Definition at line 80 of file dlt_common.c.
Referenced by dlt_message_header_flags().
char* nw_trace_type[] = {"","ipc","can","flexray","most","vfb","","","","","","","","","",""} |
Definition at line 83 of file dlt_common.c.
Referenced by dlt_message_header_flags(), dlt_user_trace_network_segmented(), dlt_user_trace_network_segmented_end(), dlt_user_trace_network_segmented_segment(), dlt_user_trace_network_segmented_start(), and dlt_user_trace_network_truncated().
|
static |
Definition at line 90 of file dlt_common.c.
Referenced by dlt_message_payload().
|
static |
Definition at line 85 of file dlt_common.c.
Referenced by dlt_client_send_reset_to_factory_default(), dlt_client_send_store_config(), dlt_message_payload(), dlt_receive_message_callback(), and dlt_register_injection_callback().
|
static |
Definition at line 68 of file dlt_common.c.
Referenced by dlt_buffer_increase_size(), dlt_buffer_info(), dlt_buffer_init_dynamic(), dlt_buffer_init_static_client(), dlt_buffer_init_static_server(), dlt_buffer_minimize_size(), dlt_buffer_status(), dlt_file_message(), dlt_file_open(), dlt_file_read(), dlt_file_read_data(), dlt_file_read_header(), dlt_file_read_header_raw(), dlt_file_read_raw(), dlt_filter_add(), dlt_filter_load(), dlt_filter_save(), dlt_message_payload(), dlt_message_read(), dlt_print_char_string(), dlt_print_hex_string(), and dlt_print_mixed_string().
char* trace_type[] = {"","variable","func_in","func_out","state","vfb","","","","","","","","","",""} |
Definition at line 82 of file dlt_common.c.
Referenced by dlt_message_header_flags().