X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fdaemon%2Fdlt_daemon_common.h;h=b93f0c2109e583801e57eb4b02f17f463675ceda;hb=d7f3cce7b39d567380a3cf8630a9312c3b5689a8;hp=1870295a6b06c4e94da759328ac839e0a9ee7f60;hpb=c870bcb94957fcbab7f56b6cd3ff5a0fc659f24c;p=profile%2Fivi%2Fdlt-daemon.git diff --git a/src/daemon/dlt_daemon_common.h b/src/daemon/dlt_daemon_common.h old mode 100755 new mode 100644 index 1870295..b93f0c2 --- a/src/daemon/dlt_daemon_common.h +++ b/src/daemon/dlt_daemon_common.h @@ -1,37 +1,22 @@ -/* - * Dlt- Diagnostic Log and Trace daemon - * @licence app begin@ - * - * Copyright (C) 2011, BMW AG - Alexander Wenzel - * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation. - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License, version 2.1, for more details. - * - * You should have received a copy of the GNU Lesser General Public License, version 2.1, along - * with this program; if not, see . - * - * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may - * also be applicable to programs even in cases in which the program is not a library in the technical sense. - * - * Linking DLT statically or dynamically with other modules is making a combined work based on DLT. You may - * license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to - * license your linked modules under the GNU Lesser General Public License, version 2.1, you - * may use the program under the following exception. - * - * As a special exception, the copyright holders of DLT give you permission to combine DLT - * with software programs or libraries that are released under any license unless such a combination is not - * permitted by the license of such a software program or library. You may copy and distribute such a - * system following the terms of the GNU Lesser General Public License, version 2.1, including this - * special exception, for DLT and the licenses of the other code concerned. - * - * Note that people who make modified versions of DLT are not obligated to grant this special exception - * for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, - * version 2.1, gives permission to release a modified version without this exception; this exception - * also makes it possible to release a modified version which carries forward this exception. - * +/** + * @licence app begin@ + * Copyright (C) 2012 BMW AG + * + * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Alexander Wenzel BMW 2011-2012 + * + * \file dlt_daemon_common.h + * For further information see http://www.genivi.org/. * @licence end@ */ @@ -88,6 +73,7 @@ \{ */ +#include #include #include "dlt_common.h" #include "dlt_user.h" @@ -96,9 +82,9 @@ extern "C" { #endif -#define DLT_DAEMON_RINGBUFFER_MIN_SIZE 100000 /**< Ring buffer size for storing log messages while no client is connected */ -#define DLT_DAEMON_RINGBUFFER_MAX_SIZE 500000 /**< Ring buffer size for storing log messages while no client is connected */ -#define DLT_DAEMON_RINGBUFFER_STEP_SIZE 100000 /**< Ring buffer size for storing log messages while no client is connected */ +#define DLT_DAEMON_RINGBUFFER_MIN_SIZE 500000 /**< Ring buffer size for storing log messages while no client is connected */ +#define DLT_DAEMON_RINGBUFFER_MAX_SIZE 10000000 /**< Ring buffer size for storing log messages while no client is connected */ +#define DLT_DAEMON_RINGBUFFER_STEP_SIZE 500000 /**< Ring buffer size for storing log messages while no client is connected */ #define DLT_DAEMON_STORE_TO_BUFFER -2 /**< Constant value to identify the command "store to buffer" */ @@ -147,16 +133,18 @@ typedef struct int8_t default_log_level; /**< Default log level (of daemon) */ int8_t default_trace_status; /**< Default trace status (of daemon) */ int message_buffer_overflow; /**< Set to one, if buffer overflow has occured, zero otherwise */ + unsigned int overflow_counter; /**< counts the number of lost messages. */ int runtime_context_cfg_loaded; /**< Set to one, if runtime context configuration has been loaded, zero otherwise */ char ecuid[DLT_ID_SIZE]; /**< ECU ID of daemon */ int sendserialheader; /**< 1: send serial header; 0 don't send serial header */ int timingpackets; /**< 1: send continous timing packets; 0 don't send continous timing packets */ DltBuffer client_ringbuffer; /**< Ring-buffer for storing received logs while no client connection is available */ - char runtime_application_cfg[256]; /**< Path and filename of persistent application configuration */ - char runtime_context_cfg[256]; /**< Path and filename of persistent context configuration */ - char runtime_configuration[256]; /**< Path and filename of persistent configuration */ + char runtime_application_cfg[PATH_MAX + 1]; /**< Path and filename of persistent application configuration. Set to path max, as it specifies a full path*/ + char runtime_context_cfg[PATH_MAX + 1]; /**< Path and filename of persistent context configuration */ + char runtime_configuration[PATH_MAX + 1]; /**< Path and filename of persistent configuration */ DltUserLogMode mode; /**< Mode used for tracing: off, external, internal, both */ char state; /**< state for tracing: 0 = no client connected, 1 = client connected */ + char *ECUVersionString; /**< Version string to send to client. Loaded from a file at startup. May be null. */ } DltDaemon; /** @@ -219,6 +207,14 @@ int dlt_daemon_applications_load(DltDaemon *daemon,const char *filename, int ver */ int dlt_daemon_applications_save(DltDaemon *daemon,const char *filename, int verbose); /** + * Invalidate all applications fd, if fd is reused + * @param daemon pointer to dlt daemon structure + * @param fd file descriptor + * @param verbose if set to true verbose information is printed out. + * @return negative value if there was an error + */ +int dlt_daemon_applications_invalidate_fd(DltDaemon *daemon,int fd,int verbose); +/** * Clear all applications in internal application management * @param daemon pointer to dlt daemon structure * @param verbose if set to true verbose information is printed out. @@ -258,6 +254,14 @@ int dlt_daemon_context_del(DltDaemon *daemon, DltDaemonContext* context, int ver */ DltDaemonContext* dlt_daemon_context_find(DltDaemon *daemon,char *apid,char *ctid,int verbose); /** + * Invalidate all contexts fd, if fd is reused + * @param daemon pointer to dlt daemon structure + * @param fd file descriptor + * @param verbose if set to true verbose information is printed out. + * @return negative value if there was an error + */ +int dlt_daemon_contexts_invalidate_fd(DltDaemon *daemon,int fd,int verbose); +/** * Clear all contexts in internal context management * @param daemon pointer to dlt daemon structure * @param verbose if set to true verbose information is printed out. @@ -357,8 +361,9 @@ void dlt_daemon_control_service_response(int sock, DltDaemon *daemon, uint32_t s * @param appid pointer to application id to be used in response message * @param contid pointer to context id to be used in response message * @param verbose if set to true verbose information is printed out. + * @return -1 if there is an error or buffer is full */ -void dlt_daemon_control_send_control_message(int sock, DltDaemon *daemon, DltMessage *msg, char* appid, char* contid, int verbose); +int dlt_daemon_control_send_control_message(int sock, DltDaemon *daemon, DltMessage *msg, char* appid, char* contid, int verbose); /** * Process and generate response to received sw injection control message @@ -435,8 +440,9 @@ void dlt_daemon_control_get_log_info(int sock, DltDaemon *daemon, DltMessage *ms * @param sock connection handle used for sending response * @param daemon pointer to dlt daemon structure * @param verbose if set to true verbose information is printed out. + * @return -1 if there is an error or buffer overflow, else 0 */ -void dlt_daemon_control_message_buffer_overflow(int sock, DltDaemon *daemon, int verbose); +int dlt_daemon_control_message_buffer_overflow(int sock, DltDaemon *daemon, unsigned int overflow_counter,char* apid, int verbose); /** * Process reset to factory default control message * @param daemon pointer to dlt daemon structure @@ -452,7 +458,6 @@ void dlt_daemon_control_reset_to_factory_default(DltDaemon *daemon,const char *f * @param verbose if set to true verbose information is printed out. */ void dlt_daemon_control_message_time(int sock, DltDaemon *daemon, int verbose); - #ifdef __cplusplus } #endif