Bug 44 - Don't print "Buffer full" message from DLT daemon for each trace.
[profile/ivi/dlt-daemon.git] / include / dlt / dlt_common.h
1 /**
2  * @licence app begin@
3  * Copyright (C) 2012  BMW AG
4  *
5  * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
6  *
7  * Contributions are licensed to the GENIVI Alliance under one or more
8  * Contribution License Agreements.
9  *
10  * \copyright
11  * This Source Code Form is subject to the terms of the
12  * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
13  * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
14  *
15  *
16  * \author Alexander Wenzel <alexander.aw.wenzel@bmw.de> BMW 2011-2012
17  *
18  * \file dlt_common.h
19  * For further information see http://www.genivi.org/.
20  * @licence end@
21  */
22
23 /*******************************************************************************
24 **                                                                            **
25 **  SRC-MODULE: dlt_common.h                                                  **
26 **                                                                            **
27 **  TARGET    : linux                                                         **
28 **                                                                            **
29 **  PROJECT   : DLT                                                           **
30 **                                                                            **
31 **  AUTHOR    : Alexander Wenzel Alexander.AW.Wenzel@bmw.de                   **
32 **              Markus Klein                                                  **
33 **                                                                            **
34 **  PURPOSE   :                                                               **
35 **                                                                            **
36 **  REMARKS   :                                                               **
37 **                                                                            **
38 **  PLATFORM DEPENDANT [yes/no]: yes                                          **
39 **                                                                            **
40 **  TO BE CHANGED BY USER [yes/no]: no                                        **
41 **                                                                            **
42 *******************************************************************************/
43
44 /*******************************************************************************
45 **                      Author Identity                                       **
46 ********************************************************************************
47 **                                                                            **
48 ** Initials     Name                       Company                            **
49 ** --------     -------------------------  ---------------------------------- **
50 **  aw          Alexander Wenzel           BMW                                **
51 **  mk          Markus Klein               Fraunhofer ESK                     **
52 *******************************************************************************/
53
54 /*******************************************************************************
55 **                      Revision Control History                              **
56 *******************************************************************************/
57
58 /*
59  * $LastChangedRevision: 1670 $
60  * $LastChangedDate: 2011-04-08 15:12:06 +0200 (Fr, 08. Apr 2011) $
61  * $LastChangedBy$
62  Initials    Date         Comment
63  aw          13.01.2010   initial
64  */
65 #ifndef DLT_COMMON_H
66 #define DLT_COMMON_H
67
68 /**
69   \defgroup commonapi DLT Common API
70   \addtogroup commonapi
71   \{
72 */
73
74 #include <stdio.h>
75
76 #if !defined(_MSC_VER)
77 #include <unistd.h>
78 #include <time.h>
79 #endif
80
81 #if !defined (__WIN32__) && !defined(_MSC_VER)
82 #include <termios.h>
83 #endif
84
85 #include "dlt_types.h"
86 #include "dlt_protocol.h"
87
88 #if !defined (PACKED)
89 #define PACKED __attribute__((aligned(1),packed))
90 #endif
91
92 #if defined (__MSDOS__) || defined (_MSC_VER)
93 /* set instead /Zp8 flag in Visual C++ configuration */
94 #undef PACKED
95 #define PACKED
96 #endif
97
98 /*
99  * Macros to swap the byte order.
100  */
101 #define DLT_SWAP_64(value) ((((uint64_t)DLT_SWAP_32((value)&0xffffffffull))<<32) | (DLT_SWAP_32((value)>>32)))
102
103 #define DLT_SWAP_16(value) ((((value) >> 8)&0xff) | (((value) << 8)&0xff00))
104 #define DLT_SWAP_32(value) ((((value) >> 24)&0xff) | (((value) << 8)&0xff0000) | (((value) >> 8)&0xff00) | (((value) << 24)&0xff000000))
105
106 /* Set Big Endian and Little Endian to a initial value, if not defined */
107 #if !defined __USE_BSD
108 #ifndef LITTLE_ENDIAN
109 #define LITTLE_ENDIAN 1234
110 #endif
111
112 #ifndef BIG_ENDIAN
113 #define BIG_ENDIAN    4321
114 #endif
115 #endif /* __USE_BSD */
116
117 /* If byte order is not defined, default to little endian */
118 #if !defined __USE_BSD
119 #ifndef BYTE_ORDER
120 #define BYTE_ORDER LITTLE_ENDIAN
121 #endif
122 #endif /* __USE_BSD */
123
124 /* Check for byte-order */
125 #if (BYTE_ORDER==BIG_ENDIAN)
126 /* #warning "Big Endian Architecture!" */
127 #define DLT_HTOBE_16(x) ((x))
128 #define DLT_HTOLE_16(x) DLT_SWAP_16((x))
129 #define DLT_BETOH_16(x) ((x))
130 #define DLT_LETOH_16(x) DLT_SWAP_16((x))
131
132 #define DLT_HTOBE_32(x) ((x))
133 #define DLT_HTOLE_32(x) DLT_SWAP_32((x))
134 #define DLT_BETOH_32(x) ((x))
135 #define DLT_LETOH_32(x) DLT_SWAP_32((x))
136
137 #define DLT_HTOBE_64(x) ((x))
138 #define DLT_HTOLE_64(x) DLT_SWAP_64((x))
139 #define DLT_BETOH_64(x) ((x))
140 #define DLT_LETOH_64(x) DLT_SWAP_64((x))
141 #else
142 /* #warning "Litte Endian Architecture!" */
143 #define DLT_HTOBE_16(x) DLT_SWAP_16((x))
144 #define DLT_HTOLE_16(x) ((x))
145 #define DLT_BETOH_16(x) DLT_SWAP_16((x))
146 #define DLT_LETOH_16(x) ((x))
147
148 #define DLT_HTOBE_32(x) DLT_SWAP_32((x))
149 #define DLT_HTOLE_32(x) ((x))
150 #define DLT_BETOH_32(x) DLT_SWAP_32((x))
151 #define DLT_LETOH_32(x) ((x))
152
153 #define DLT_HTOBE_64(x) DLT_SWAP_64((x))
154 #define DLT_HTOLE_64(x) ((x))
155 #define DLT_BETOH_64(x) DLT_SWAP_64((x))
156 #define DLT_LETOH_64(x) ((x))
157 #endif
158
159 #define DLT_ENDIAN_GET_16(htyp,x) ((((htyp) & DLT_HTYP_MSBF)>0)?DLT_BETOH_16(x):DLT_LETOH_16(x))
160 #define DLT_ENDIAN_GET_32(htyp,x) ((((htyp) & DLT_HTYP_MSBF)>0)?DLT_BETOH_32(x):DLT_LETOH_32(x))
161 #define DLT_ENDIAN_GET_64(htyp,x) ((((htyp) & DLT_HTYP_MSBF)>0)?DLT_BETOH_64(x):DLT_LETOH_64(x))
162
163 #if defined (__WIN32__) || defined (_MSC_VER)
164 #define LOG_EMERG       0
165 #define LOG_ALERT       1
166 #define LOG_CRIT        2
167 #define LOG_ERR         3
168 #define LOG_WARNING     4
169 #define LOG_NOTICE      5
170 #define LOG_INFO        6
171 #define LOG_DEBUG       7
172
173 #define LOG_PID         0x01
174 #define LOG_DAEMON      (3<<3)
175 #endif
176
177 /**
178  * The standard TCP Port used for DLT daemon
179  */
180 #define DLT_DAEMON_TCP_PORT 3490
181
182
183 /* Initi value for file descritpor */
184 #define DLT_FD_INIT -1
185
186 /* Minimum value for a file descriptor except the POSIX Standards: stdin=0, stdout=1, stderr=2 */
187 #define DLT_FD_MINIMUM 3
188
189 /**
190  * The size of a DLT ID
191  */
192 #define DLT_ID_SIZE 4
193
194 #define DLT_SIZE_WEID DLT_ID_SIZE
195 #define DLT_SIZE_WSID (sizeof(uint32_t))
196 #define DLT_SIZE_WTMS (sizeof(uint32_t))
197
198 /**
199  * Get the size of extra header parameters, depends on htyp.
200  */
201 #define DLT_STANDARD_HEADER_EXTRA_SIZE(htyp) ( (DLT_IS_HTYP_WEID(htyp) ? DLT_SIZE_WEID : 0) + (DLT_IS_HTYP_WSID(htyp) ? DLT_SIZE_WSID : 0) + (DLT_IS_HTYP_WTMS(htyp) ? DLT_SIZE_WTMS : 0) )
202
203
204 #if defined (__MSDOS__) || defined (_MSC_VER)
205 #define __func__ __FUNCTION__
206 #endif
207
208 #define PRINT_FUNCTION_VERBOSE(_verbose)  \
209 { \
210         static char _strbuf[255]; \
211     \
212     if(_verbose) \
213     { \
214                 snprintf(_strbuf, 255, "%s()\n",__func__); \
215                 dlt_log(LOG_INFO, _strbuf); \
216     } \
217 }
218
219 #ifndef NULL
220 #define NULL (char*)0
221 #endif
222
223 #define DLT_MSG_IS_CONTROL(MSG)          ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \
224                                           (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL))
225
226 #define DLT_MSG_IS_CONTROL_REQUEST(MSG)  ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \
227                                           (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \
228                                           (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_REQUEST))
229
230 #define DLT_MSG_IS_CONTROL_RESPONSE(MSG) ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \
231                                           (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \
232                                           (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_RESPONSE))
233
234 #define DLT_MSG_IS_CONTROL_TIME(MSG)     ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \
235                                           (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_CONTROL) && \
236                                           (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_CONTROL_TIME))
237
238 #define DLT_MSG_IS_NW_TRACE(MSG)         ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \
239                                                                               (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_NW_TRACE))
240
241 #define DLT_MSG_IS_TRACE_MOST(MSG)       ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && \
242                                                                               (DLT_GET_MSIN_MSTP((MSG)->extendedheader->msin)==DLT_TYPE_NW_TRACE) && \
243                                                                               (DLT_GET_MSIN_MTIN((MSG)->extendedheader->msin)==DLT_NW_TRACE_MOST))
244
245 #define DLT_MSG_IS_NONVERBOSE(MSG)       (!(DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) || \
246                                           ((DLT_IS_HTYP_UEH((MSG)->standardheader->htyp)) && (!(DLT_IS_MSIN_VERB((MSG)->extendedheader->msin)))))
247
248 /*
249
250  * Definitions of DLT message buffer overflow
251  */
252 #define DLT_MESSAGE_BUFFER_NO_OVERFLOW     0x00 /**< Buffer overflow has not occured */
253 #define DLT_MESSAGE_BUFFER_OVERFLOW        0x01 /**< Buffer overflow has occured */
254
255 /*
256  * Definition of DLT output variants
257  */
258 #define DLT_OUTPUT_HEX              1
259 #define DLT_OUTPUT_ASCII            2
260 #define DLT_OUTPUT_MIXED_FOR_PLAIN  3
261 #define DLT_OUTPUT_MIXED_FOR_HTML   4
262 #define DLT_OUTPUT_ASCII_LIMITED    5
263
264 #define DLT_FILTER_MAX 30 /**< Maximum number of filters */
265
266 #define DLT_MSG_READ_VALUE(dst,src,length,type) \
267     { \
268     if((length<0) || ((length)<((int32_t)sizeof(type)))) \
269         { length = -1; } \
270     else \
271         { dst = *((type*)src);src+=sizeof(type);length-=sizeof(type); } \
272     }
273
274 #define DLT_MSG_READ_ID(dst,src,length) \
275     { \
276     if((length<0) || ((length)<DLT_ID_SIZE)) \
277         { length = -1; } \
278     else \
279         { memcpy(dst,src,DLT_ID_SIZE);src+=DLT_ID_SIZE;length-=DLT_ID_SIZE; } \
280     }
281
282 #define DLT_MSG_READ_STRING(dst,src,maxlength,length) \
283     { \
284     if(((maxlength)<0) || ((length)<0) || ((maxlength)<(length))) \
285         { maxlength = -1; } \
286     else \
287         { memcpy(dst,src,length);dlt_clean_string(dst,length);dst[length]=0; \
288           src+=length;maxlength-=length; } \
289     }
290
291 #define DLT_MSG_READ_NULL(src,maxlength,length) \
292     { \
293     if(((maxlength)<0) || ((length)<0) || ((maxlength)<(length))) \
294         { length = -1; } \
295     else \
296         { src+=length;maxlength-=length; } \
297     }
298
299 #define DLT_HEADER_SHOW_NONE       0x0000
300 #define DLT_HEADER_SHOW_TIME       0x0001
301 #define DLT_HEADER_SHOW_TMSTP      0x0002
302 #define DLT_HEADER_SHOW_MSGCNT     0x0004
303 #define DLT_HEADER_SHOW_ECUID      0x0008
304 #define DLT_HEADER_SHOW_APID       0x0010
305 #define DLT_HEADER_SHOW_CTID       0x0020
306 #define DLT_HEADER_SHOW_MSGTYPE    0x0040
307 #define DLT_HEADER_SHOW_MSGSUBTYPE 0x0080
308 #define DLT_HEADER_SHOW_VNVSTATUS  0x0100
309 #define DLT_HEADER_SHOW_NOARG      0x0200
310 #define DLT_HEADER_SHOW_ALL        0xFFFF
311
312 /**
313  * The definition of the serial header containing the characters "DLS" + 0x01.
314  */
315 extern const char dltSerialHeader[DLT_ID_SIZE];
316
317 /**
318  * The definition of the serial header containing the characters "DLS" + 0x01 as char.
319  */
320 extern char dltSerialHeaderChar[DLT_ID_SIZE];
321
322 /**
323
324  * The type of a DLT ID (context id, application id, etc.)
325  */
326 typedef char ID4[DLT_ID_SIZE];
327
328 /**
329  * The structure of the DLT file storage header. This header is used before each stored DLT message.
330  */
331 typedef struct
332 {
333     char pattern[DLT_ID_SIZE];          /**< This pattern should be DLT0x01 */
334     uint32_t seconds;                               /**< seconds since 1.1.1970 */
335     int32_t microseconds;                       /**< Microseconds */
336     char ecu[DLT_ID_SIZE];                      /**< The ECU id is added, if it is not already in the DLT message itself */
337 } PACKED DltStorageHeader;
338
339 /**
340  * The structure of the DLT standard header. This header is used in each DLT message.
341  */
342 typedef struct
343 {
344     uint8_t htyp;           /**< This parameter contains several informations, see definitions below */
345     uint8_t mcnt;           /**< The message counter is increased with each sent DLT message */
346     uint16_t len;           /**< Length of the complete message, without storage header */
347 } PACKED DltStandardHeader;
348
349 /**
350  * The structure of the DLT extra header parameters. Each parameter is sent only if enabled in htyp.
351  */
352 typedef struct
353 {
354     char ecu[DLT_ID_SIZE];       /**< ECU id */
355     uint32_t seid;     /**< Session number */
356     uint32_t tmsp;     /**< Timestamp since system start in 0.1 milliseconds */
357 } PACKED DltStandardHeaderExtra;
358
359 /**
360  * The structure of the DLT extended header. This header is only sent if enabled in htyp parameter.
361  */
362 typedef struct
363 {
364     uint8_t msin;          /**< messsage info */
365     uint8_t noar;          /**< number of arguments */
366     char apid[DLT_ID_SIZE];          /**< application id */
367     char ctid[DLT_ID_SIZE];          /**< context id */
368 } PACKED DltExtendedHeader;
369
370 /**
371  * The structure to organise the DLT messages.
372  * This structure is used by the corresponding functions.
373  */
374 typedef struct sDltMessage
375 {
376     /* flags */
377     int8_t found_serialheader;
378
379     /* offsets */
380     int32_t resync_offset;
381
382     /* size parameters */
383     int32_t headersize;    /**< size of complete header including storage header */
384     int32_t datasize;      /**< size of complete payload */
385
386     /* buffer for current loaded message */
387     uint8_t headerbuffer[sizeof(DltStorageHeader)+
388                          sizeof(DltStandardHeader)+sizeof(DltStandardHeaderExtra)+sizeof(DltExtendedHeader)]; /**< buffer for loading complete header */
389     uint8_t *databuffer;         /**< buffer for loading payload */
390         int32_t databuffersize;
391
392     /* header values of current loaded message */
393     DltStorageHeader       *storageheader;  /**< pointer to storage header of current loaded header */
394     DltStandardHeader      *standardheader; /**< pointer to standard header of current loaded header */
395     DltStandardHeaderExtra headerextra;     /**< extra parameters of current loaded header */
396     DltExtendedHeader      *extendedheader; /**< pointer to extended of current loaded header */
397 } DltMessage;
398
399 /**
400  * The structure of the DLT Service Get Log Info.
401  */
402 typedef struct
403 {
404     uint32_t service_id;            /**< service ID */
405     uint8_t options;                /**< type of request */
406     char apid[DLT_ID_SIZE];                   /**< application id */
407     char ctid[DLT_ID_SIZE];                   /**< context id */
408     char com[DLT_ID_SIZE];                    /**< communication interface */
409 } PACKED DltServiceGetLogInfoRequest;
410
411 /**
412  * The structure of the DLT Service Set Log Level.
413  */
414 typedef struct
415 {
416
417     uint32_t service_id;            /**< service ID */
418     char apid[DLT_ID_SIZE];                   /**< application id */
419     char ctid[DLT_ID_SIZE];                   /**< context id */
420     uint8_t log_level;              /**< log level to be set */
421     char com[DLT_ID_SIZE];                    /**< communication interface */
422 } PACKED DltServiceSetLogLevel;
423
424 /**
425  * The structure of the DLT Service Set Default Log Level.
426  */
427 typedef struct
428 {
429     uint32_t service_id;            /**< service ID */
430     uint8_t log_level;              /**< default log level to be set */
431     char com[DLT_ID_SIZE];                    /**< communication interface */
432 } PACKED DltServiceSetDefaultLogLevel;
433
434 /**
435  * The structure of the DLT Service Set Verbose Mode
436  */
437 typedef struct
438 {
439     uint32_t service_id;            /**< service ID */
440     uint8_t new_status;             /**< new status to be set */
441 } PACKED DltServiceSetVerboseMode;
442
443 /**
444  * The structure of the DLT Service Set Communication Interface Status
445  */
446 typedef struct
447 {
448     uint32_t service_id;            /**< service ID */
449     char com[DLT_ID_SIZE];                    /**< communication interface */
450     uint8_t new_status;             /**< new status to be set */
451 } PACKED DltServiceSetCommunicationInterfaceStatus;
452
453 /**
454  * The structure of the DLT Service Set Communication Maximum Bandwidth
455  */
456 typedef struct
457 {
458     uint32_t service_id;            /**< service ID */
459     char com[DLT_ID_SIZE];                    /**< communication interface */
460     uint32_t max_bandwidth;         /**< maximum bandwith */
461 } PACKED DltServiceSetCommunicationMaximumBandwidth;
462
463 typedef struct
464 {
465     uint32_t service_id;            /**< service ID */
466     uint8_t status;                 /**< reponse status */
467 } PACKED DltServiceResponse;
468
469 typedef struct
470 {
471     uint32_t service_id;            /**< service ID */
472     uint8_t status;                 /**< reponse status */
473     uint8_t log_level;              /**< log level */
474 } PACKED DltServiceGetDefaultLogLevelResponse;
475
476 typedef struct
477 {
478     uint32_t service_id;            /**< service ID */
479     uint8_t status;                 /**< reponse status */
480     uint8_t overflow;               /**< overflow status */
481     uint32_t overflow_counter;      /**< overflow counter */
482 } PACKED DltServiceMessageBufferOverflowResponse;
483
484 typedef struct
485 {
486     uint32_t service_id;            /**< service ID */
487     uint8_t  status;                /**< reponse status */
488     uint32_t length;                /**< length of following payload */
489     /*char [] payload;*/
490 } PACKED DltServiceGetSoftwareVersionResponse;
491
492 /**
493  * Structure to store filter parameters.
494  * ID are maximal four characters. Unused values are filled with zeros.
495  * If every value as filter is valid, the id should be empty by having only zero values.
496  */
497 typedef struct
498 {
499     char apid[DLT_FILTER_MAX][DLT_ID_SIZE]; /**< application id */
500     char ctid[DLT_FILTER_MAX][DLT_ID_SIZE]; /**< context id */
501     int  counter;                           /**< number of filters */
502 } DltFilter;
503
504 /**
505  * The structure to organise the access to DLT files.
506  * This structure is used by the corresponding functions.
507  */
508 typedef struct sDltFile
509 {
510     /* file handle and index for fast access */
511     FILE *handle;      /**< file handle of opened DLT file */
512     long *index;       /**< file positions of all DLT messages for fast access to file, only filtered messages */
513
514     /* size parameters */
515     int32_t counter;       /**< number of messages in DLT file with filter */
516     int32_t counter_total; /**< number of messages in DLT file without filter */
517     int32_t position;      /**< current index to message parsed in DLT file starting at 0 */
518     long file_length;  /**< length of the file */
519     long file_position; /**< current position in the file */
520
521     /* error counters */
522     int32_t error_messages; /**< number of incomplete DLT messages found during file parsing */
523
524     /* filter parameters */
525     DltFilter *filter;  /**< pointer to filter list. Zero if no filter is set. */
526     int32_t filter_counter; /**< number of filter set */
527
528     /* current loaded message */
529     DltMessage msg;     /**< pointer to message */
530
531 } DltFile;
532
533 /**
534  * The structure is used to organise the receiving of data
535  * including buffer handling.
536  * This structure is used by the corresponding functions.
537  */
538 typedef struct
539 {
540     int32_t lastBytesRcvd;    /**< bytes received in last receive call */
541     int32_t bytesRcvd;        /**< received bytes */
542     int32_t totalBytesRcvd;   /**< total number of received bytes */
543     char *buffer;         /**< pointer to receiver buffer */
544     char *buf;            /**< pointer to position within receiver buffer */
545     int fd;               /**< connection handle */
546     int32_t buffersize;       /**< size of receiver buffer */
547 } DltReceiver;
548
549 typedef struct
550 {
551         unsigned char* shm;     /* pointer to beginning of shared memory */
552         int size;       /* size of data area in shared memory */
553         unsigned char* mem;     /* pointer to data area in shared memory */     
554         
555     uint32_t    min_size;  /**< Minimum size of buffer */
556     uint32_t    max_size;  /**< Maximum size of buffer */
557     uint32_t    step_size; /**< Step size of buffer */
558 } DltBuffer;
559
560 typedef struct
561 {
562         int write;
563         int read;
564         int count;      
565 } DltBufferHead;
566
567 #define DLT_BUFFER_HEAD         "SHM"
568
569 typedef struct
570 {
571         char head[4];
572         unsigned char status;
573         int size;       
574 } DltBufferBlockHead;
575
576 #ifdef __cplusplus
577 extern "C"
578 {
579 #endif
580
581     /**
582      * Helper function to print a byte array in hex.
583      * @param ptr pointer to the byte array.
584      * @param size number of bytes to be printed.
585      */
586     void dlt_print_hex(uint8_t *ptr,int size);
587     /**
588      * Helper function to print a byte array in hex into a string.
589      * @param text pointer to a ASCII string, in which the text is written
590      * @param textlength maximal size of text buffer
591      * @param ptr pointer to the byte array.
592      * @param size number of bytes to be printed.
593      * @return negative value if there was an error
594      */
595     int dlt_print_hex_string(char *text,int textlength,uint8_t *ptr,int size);
596     /**
597      * Helper function to print a byte array in hex and ascii into a string.
598      * @param text pointer to a ASCII string, in which the text is written
599      * @param textlength maximal size of text buffer
600      * @param ptr pointer to the byte array.
601      * @param size number of bytes to be printed.
602      * @param html output is html? 0 - false, 1 - true
603      * @return negative value if there was an error
604      */
605     int dlt_print_mixed_string(char *text,int textlength,uint8_t *ptr,int size,int html);
606     /**
607      * Helper function to print a byte array in ascii into a string.
608      * @param text pointer to a ASCII string, in which the text is written
609      * @param textlength maximal size of text buffer
610      * @param ptr pointer to the byte array.
611      * @param size number of bytes to be printed.
612      * @return negative value if there was an error
613      */
614     int dlt_print_char_string(char **text,int textlength,uint8_t *ptr,int size);
615
616     /**
617      * Helper function to print an id.
618      * @param text pointer to ASCII string where to write the id
619      * @param id four byte char array as used in DLT mesages as IDs.
620      */
621     void dlt_print_id(char *text,const char *id);
622
623     /**
624      * Helper function to set an ID parameter.
625      * @param id four byte char array as used in DLT mesages as IDs.
626      * @param text string to be copied into char array.
627      */
628     void dlt_set_id(char *id,const char *text);
629
630     /**
631      * Helper function to remove not nice to print characters, e.g. NULL or carage return.
632      * @param text pointer to string to be cleaned.
633      * @param length length of string excluding terminating zero.
634      */
635     void dlt_clean_string(char *text,int length);
636
637     /**
638      * Initialise the filter list.
639      * This function must be called before using further dlt filter.
640      * @param filter pointer to structure of organising DLT filter
641      * @param verbose if set to true verbose information is printed out.
642      * @return negative value if there was an error
643      */
644     int dlt_filter_init(DltFilter *filter,int verbose);
645     /**
646      * Free the used memory by the organising structure of filter.
647      * @param filter pointer to structure of organising DLT filter
648      * @param verbose if set to true verbose information is printed out.
649      * @return negative value if there was an error
650      */
651     int dlt_filter_free(DltFilter *filter,int verbose);
652     /**
653      * Load filter list from file.
654      * @param filter pointer to structure of organising DLT filter
655      * @param filename filename to load filters from
656      * @param verbose if set to true verbose information is printed out.
657      * @return negative value if there was an error
658      */
659     int dlt_filter_load(DltFilter *filter,const char *filename,int verbose);
660     /**
661      * Save filter list to file.
662      * @param filter pointer to structure of organising DLT filter
663      * @param filename filename to load filters from
664      * @param verbose if set to true verbose information is printed out.
665      * @return negative value if there was an error
666      */
667     int dlt_filter_save(DltFilter *filter,const char *filename,int verbose);
668     /**
669      * Find index of filter in filter list
670      * @param filter pointer to structure of organising DLT filter
671      * @param apid application id to be found in filter list
672      * @param ctid context id to be found in filter list
673      * @param verbose if set to true verbose information is printed out.
674      * @return negative value if there was an error (or not found), else return index of filter
675      */
676     int dlt_filter_find(DltFilter *filter,const char *apid,const char *ctid, int verbose);
677     /**
678      * Add new filter to filter list.
679      * @param filter pointer to structure of organising DLT filter
680      * @param apid application id to be added to filter list (must always be set).
681      * @param ctid context id to be added to filter list. empty equals don't care.
682      * @param verbose if set to true verbose information is printed out.
683      * @return negative value if there was an error
684      */
685     int dlt_filter_add(DltFilter *filter,const char *apid,const char *ctid,int verbose);
686     /**
687      * Delete filter from filter list
688      * @param filter pointer to structure of organising DLT filter
689      * @param apid application id to be deleted from filter list
690      * @param ctid context id to be deleted from filter list
691      * @param verbose if set to true verbose information is printed out.
692      * @return negative value if there was an error
693      */
694     int dlt_filter_delete(DltFilter *filter,const char *apid,const char *ctid,int verbose);
695
696     /**
697      * Initialise the structure used to access a DLT message.
698      * This function must be called before using further dlt_message functions.
699      * @param msg pointer to structure of organising access to DLT messages
700      * @param verbose if set to true verbose information is printed out.
701      * @return negative value if there was an error
702      */
703     int dlt_message_init(DltMessage *msg,int verbose);
704     /**
705      * Free the used memory by the organising structure of file.
706      * @param msg pointer to structure of organising access to DLT messages
707      * @param verbose if set to true verbose information is printed out.
708      * @return negative value if there was an error
709      */
710     int dlt_message_free(DltMessage *msg,int verbose);
711     /**
712      * Print Header into an ASCII string.
713      * This function calls dlt_message_header_flags() with flags=DLT_HEADER_SHOW_ALL
714      * @param msg pointer to structure of organising access to DLT messages
715      * @param text pointer to a ASCII string, in which the header is written
716      * @param textlength maximal size of text buffer
717      * @param verbose if set to true verbose information is printed out.
718      * @return negative value if there was an error
719      */
720     int dlt_message_header(DltMessage *msg,char *text,int textlength,int verbose);
721     /**
722      * Print Header into an ASCII string, selective.
723      * @param msg pointer to structure of organising access to DLT messages
724      * @param text pointer to a ASCII string, in which the header is written
725      * @param textlength maximal size of text buffer
726      * @param flags select, bit-field to select, what should be printed (DLT_HEADER_SHOW_...)
727      * @param verbose if set to true verbose information is printed out.
728      * @return negative value if there was an error
729      */
730     int dlt_message_header_flags(DltMessage *msg,char *text,int textlength,int flags, int verbose);
731     /**
732      * Print Payload into an ASCII string.
733      * @param msg pointer to structure of organising access to DLT messages
734      * @param text pointer to a ASCII string, in which the header is written
735      * @param textlength maximal size of text buffer
736      * @param type 1 = payload as hex, 2 = payload as ASCII.
737      * @param verbose if set to true verbose information is printed out.
738      * @return negative value if there was an error
739      */
740     int dlt_message_payload(DltMessage *msg,char *text,int textlength,int type,int verbose);
741     /**
742      * Check if message is filtered or not. All filters are applied (logical OR).
743      * @param msg pointer to structure of organising access to DLT messages
744      * @param filter pointer to filter
745      * @param verbose if set to true verbose information is printed out.
746      * @return 1 = filter matches, 0 = filter does not match, negative value if there was an error
747      */
748     int dlt_message_filter_check(DltMessage *msg,DltFilter *filter,int verbose);
749
750     /**
751      * Read message from memory buffer.
752      * Message in buffer has no storage header.
753      * @param msg pointer to structure of organising access to DLT messages
754      * @param buffer pointer to memory buffer
755      * @param length length of message in buffer
756      * @param resync if set to true resync to serial header is enforced
757      * @param verbose if set to true verbose information is printed out.
758      * @return negative value if there was an error
759      */
760     int dlt_message_read(DltMessage *msg,uint8_t *buffer,unsigned int length,int resync,int verbose);
761
762     /**
763      * Get standard header extra parameters
764      * @param msg pointer to structure of organising access to DLT messages
765      * @param verbose if set to true verbose information is printed out.
766      * @return negative value if there was an error
767      */
768     int dlt_message_get_extraparameters(DltMessage *msg,int verbose);
769
770     /**
771      * Set standard header extra parameters
772      * @param msg pointer to structure of organising access to DLT messages
773      * @param verbose if set to true verbose information is printed out.
774      * @return negative value if there was an error
775      */
776     int dlt_message_set_extraparameters(DltMessage *msg,int verbose);
777
778     /**
779      * Initialise the structure used to access a DLT file.
780      * This function must be called before using further dlt_file functions.
781      * @param file pointer to structure of organising access to DLT file
782      * @param verbose if set to true verbose information is printed out.
783      * @return negative value if there was an error
784      */
785     int dlt_file_init(DltFile *file,int verbose);
786     /**
787      * Set a list to filters.
788      * This function should be called before loading a DLT file, if filters should be used.
789      * A filter list is an array of filters. Several filters are combined logically by or operation.
790      * The filter list is not copied, so take care to keep list in memory.
791      * @param file pointer to structure of organising access to DLT file
792      * @param filter pointer to filter list array
793      * @param verbose if set to true verbose information is printed out.
794      * @return negative value if there was an error
795      */
796     int dlt_file_set_filter(DltFile *file,DltFilter *filter,int verbose);
797     /**
798      * Initialising loading a DLT file.
799      * @param file pointer to structure of organising access to DLT file
800      * @param filename filename of DLT file
801      * @param verbose if set to true verbose information is printed out.
802      * @return negative value if there was an error
803      */
804     int dlt_file_open(DltFile *file,const char *filename,int verbose);
805     /**
806      * Find next message in the DLT file and parse them.
807      * This function finds the next message in the DLT file.
808      * If a filter is set, the filter list is used.
809      * @param file pointer to structure of organising access to DLT file
810      * @param verbose if set to true verbose information is printed out.
811      * @return 0 = message does not match filter, 1 = message was read, negative value if there was an error
812      */
813     int dlt_file_read(DltFile *file,int verbose);
814     /**
815      * Find next message in the DLT file in RAW format (without storage header) and parse them.
816      * This function finds the next message in the DLT file.
817      * If a filter is set, the filter list is used.
818      * @param file pointer to structure of organising access to DLT file
819      * @param resync Resync to serial header when set to true
820      * @param verbose if set to true verbose information is printed out.
821      * @return 0 = message does not match filter, 1 = message was read, negative value if there was an error
822      */
823     int dlt_file_read_raw(DltFile *file,int resync,int verbose);
824     /**
825      * Closing loading a DLT file.
826      * @param file pointer to structure of organising access to DLT file
827      * @param verbose if set to true verbose information is printed out.
828      * @return negative value if there was an error
829      */
830     int dlt_file_close(DltFile *file,int verbose);
831     /**
832      * Load standard header of a message from file
833      * @param file pointer to structure of organising access to DLT file
834      * @param verbose if set to true verbose information is printed out.
835      * @return negative value if there was an error
836      */
837     int dlt_file_read_header(DltFile *file,int verbose);
838     /**
839      * Load standard header of a message from file in RAW format (without storage header)
840      * @param file pointer to structure of organising access to DLT file
841      * @param resync Resync to serial header when set to true
842      * @param verbose if set to true verbose information is printed out.
843      * @return negative value if there was an error
844      */
845     int dlt_file_read_header_raw(DltFile *file,int resync,int verbose);
846     /**
847      * Load, if available in message, extra standard header fields and
848      * extended header of a message from file
849      * (dlt_file_read_header() must have been called before this call!)
850      * @param file pointer to structure of organising access to DLT file
851      * @param verbose if set to true verbose information is printed out.
852      * @return negative value if there was an error
853      */
854     int dlt_file_read_header_extended(DltFile *file, int verbose);
855     /**
856      * Load payload of a message from file
857      * (dlt_file_read_header() must have been called before this call!)
858      * @param file pointer to structure of organising access to DLT file
859      * @param verbose if set to true verbose information is printed out.
860      * @return negative value if there was an error
861      */
862     int dlt_file_read_data(DltFile *file, int verbose);
863     /**
864      * Load headers and payload of a message selected by the index.
865      * If filters are set, index is based on the filtered list.
866      * @param file pointer to structure of organising access to DLT file
867      * @param index position of message in the files beginning from zero
868      * @param verbose if set to true verbose information is printed out.
869      * @return number of messages loaded, negative value if there was an error
870      */
871     int dlt_file_message(DltFile *file,int index,int verbose);
872     /**
873      * Free the used memory by the organising structure of file.
874      * @param file pointer to structure of organising access to DLT file
875      * @param verbose if set to true verbose information is printed out.
876      * @return negative value if there was an error
877      */
878     int dlt_file_free(DltFile *file,int verbose);
879
880     /**
881      * Set internal logging filename if mode 2
882      * @param filename the filename
883      */
884     void dlt_log_set_filename(const char *filename);
885     /**
886      * Set internal logging level
887      * @param level the level
888      */
889     void dlt_log_set_level(int level);
890     /**
891      * Initialize (external) logging facility
892      * @param mode positive, 0 = log to stdout, 1 = log to syslog, 2 = log to file
893      */
894     void dlt_log_init(int mode);
895     /**
896      * Log ASCII string with null-termination to (external) logging facility
897      * @param prio priority (see syslog() call)
898      * @param s Pointer to ASCII string with null-termination
899      * @return negative value if there was an error
900      */
901     int dlt_log(int prio, char *s);
902     /**
903      * De-Initialize (external) logging facility
904      */
905     void dlt_log_free(void);
906
907     /**
908      * Initialising a dlt receiver structure
909      * @param receiver pointer to dlt receiver structure
910      * @param _fd handle to file/socket/fifo, fram which the data should be received
911      * @param _buffersize size of data buffer for storing the received data
912      * @return negative value if there was an error
913      */
914     int dlt_receiver_init(DltReceiver *receiver,int _fd, int _buffersize);
915     /**
916      * De-Initialize a dlt receiver structure
917      * @param receiver pointer to dlt receiver structure
918      * @return negative value if there was an error
919      */
920     int dlt_receiver_free(DltReceiver *receiver);
921     /**
922      * Receive data from socket using the dlt receiver structure
923      * @param receiver pointer to dlt receiver structure
924      * @return negative value if there was an error
925      */
926     int dlt_receiver_receive_socket(DltReceiver *receiver);
927     /**
928      * Receive data from file/fifo using the dlt receiver structure
929      * @param receiver pointer to dlt receiver structure
930      * @return negative value if there was an error
931      */
932     int dlt_receiver_receive_fd(DltReceiver *receiver);
933     /**
934      * Remove a specific size of bytes from the received data
935      * @param receiver pointer to dlt receiver structure
936      * @param size amount of bytes to be removed
937      * @return negative value if there was an error
938      */
939     int dlt_receiver_remove(DltReceiver *receiver,int size);
940     /**
941      * Move data from last receive call to front of receive buffer
942      * @param receiver pointer to dlt receiver structure
943      * @return negative value if there was an error
944      */
945     int dlt_receiver_move_to_begin(DltReceiver *receiver);
946
947     /**
948      * Fill out storage header of a dlt message
949      * @param storageheader pointer to storage header of a dlt message
950      * @param ecu name of ecu to be set in storage header
951      * @return negative value if there was an error
952      */
953     int dlt_set_storageheader(DltStorageHeader *storageheader, const char *ecu);
954     /**
955      * Check if a storage header contains its marker
956      * @param storageheader pointer to storage header of a dlt message
957      * @return 0 no, 1 yes, negative value if there was an error
958      */
959     int dlt_check_storageheader(DltStorageHeader *storageheader);
960
961
962     /**
963      * Initialise static ringbuffer with a size of size.
964      * Initialise as server. Init counters. 
965      * Memory is already allocated.
966      * @param buf Pointer to ringbuffer structure
967      * @param ptr Ptr to ringbuffer memory
968      * @param size Maximum size of buffer in bytes
969      * @return negative value if there was an error
970      */
971     int dlt_buffer_init_static_server(DltBuffer *buf, const unsigned char *ptr, uint32_t size);
972
973     /**
974      * Initialize static ringbuffer with a size of size.
975      * Initialise as a client. Do not change counters.
976      * Memory is already allocated.
977      * @param buf Pointer to ringbuffer structure
978      * @param ptr Ptr to ringbuffer memory
979      * @param size Maximum size of buffer in bytes
980      * @return negative value if there was an error
981      */
982     int dlt_buffer_init_static_client(DltBuffer *buf, const unsigned char *ptr, uint32_t size);
983
984     /**
985      * Initialize dynamic ringbuffer with a size of size.
986      * Initialise as a client. Do not change counters.
987      * Memory will be allocated starting with min_size.
988      * If more memory is needed size is increased wit step_size.
989      * The maximum size is max_size.
990      * @param buf Pointer to ringbuffer structure
991      * @param min_size Minimum size of buffer in bytes
992      * @param max_size Maximum size of buffer in bytes
993      * @param step_size size of which ringbuffer is increased
994      * @return negative value if there was an error
995      */
996     int dlt_buffer_init_dynamic(DltBuffer *buf, uint32_t min_size, uint32_t max_size,uint32_t step_size);
997
998     /**
999      * Deinitilaise usage of static ringbuffer
1000      * @param buf Pointer to ringbuffer structure
1001      * @return negative value if there was an error
1002      */
1003     int dlt_buffer_free_static(DltBuffer *buf);
1004
1005     /**
1006      * Release and free memory used by dynamic ringbuffer
1007      * @param buf Pointer to ringbuffer structure
1008      * @return negative value if there was an error
1009      */
1010     int dlt_buffer_free_dynamic(DltBuffer *buf);
1011
1012     /**
1013      * Write one entry to ringbuffer
1014      * @param buf Pointer to ringbuffer structure
1015      * @param data Pointer to data to be written to ringbuffer
1016      * @param size Size of data in bytes to be written to ringbuffer
1017      * @return negative value if there was an error
1018      */
1019         int dlt_buffer_push(DltBuffer *buf,const unsigned char *data,unsigned int size);
1020
1021     /**
1022      * Write up to three entries to ringbuffer.
1023      * Entries are joined to one block.
1024      * @param dlt Pointer to ringbuffer structure
1025      * @param data1 Pointer to data to be written to ringbuffer
1026      * @param size1 Size of data in bytes to be written to ringbuffer
1027      * @param data2 Pointer to data to be written to ringbuffer
1028      * @param size2 Size of data in bytes to be written to ringbuffer
1029      * @param data3 Pointer to data to be written to ringbuffer
1030      * @param size3 Size of data in bytes to be written to ringbuffer
1031      * @return negative value if there was an error
1032      */
1033         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);
1034
1035     /**
1036      * Read one entry from ringbuffer.
1037      * Remove it from ringbuffer.
1038      * @param buf Pointer to ringbuffer structure
1039      * @param data Pointer to data read from ringbuffer
1040      * @param max_size Max size of read data in bytes from ringbuffer
1041      * @return size of read data, zero if no data available, negative value if there was an error
1042      */
1043         int dlt_buffer_pull(DltBuffer *buf,unsigned char *data, int max_size);
1044
1045     /**
1046      * Read one entry from ringbuffer.
1047      * Do not remove it from ringbuffer.
1048      * @param buf Pointer to ringbuffer structure
1049      * @param data Pointer to data read from ringbuffer
1050      * @param max_size Max size of read data in bytes from ringbuffer
1051      * @return size of read data, zero if no data available, negative value if there was an error
1052      */
1053         int dlt_buffer_copy(DltBuffer *buf,unsigned char *data, int max_size);
1054
1055     /**
1056      * Remove entry from ringbuffer.
1057      * @param buf Pointer to ringbuffer structure
1058      * @return size of read data, zero if no data available, negative value if there was an error
1059      */
1060         int dlt_buffer_remove(DltBuffer *buf);
1061
1062     /**
1063      * Print information about buffer and log to internal DLT log.
1064      * @param buf Pointer to ringbuffer structure
1065      */
1066         void dlt_buffer_info(DltBuffer *buf);
1067
1068     /**
1069      * Print status of buffer and log to internal DLT log.
1070      * @param buf Pointer to ringbuffer structure
1071      */
1072         void dlt_buffer_status(DltBuffer *buf);
1073
1074     /**
1075      * Get total size in bytes of ringbuffer.
1076      * If buffer is dynamic, max size is returned.
1077      * @param buf Pointer to ringbuffer structure
1078      * @return total size of buffer
1079      */
1080         int dlt_buffer_get_total_size(DltBuffer *buf);
1081
1082     /**
1083      * Get used size in bytes of ringbuffer.
1084      * @param buf Pointer to ringbuffer structure
1085      * @return used size of buffer
1086      */
1087         int dlt_buffer_get_used_size(DltBuffer *buf);
1088
1089     /**
1090      * Get number of entries in ringbuffer.
1091      * @param buf Pointer to ringbuffer structure
1092      * @return number of entries
1093      */
1094         int dlt_buffer_get_message_count(DltBuffer *buf);
1095
1096 #if !defined (__WIN32__)
1097
1098     /**
1099      * Helper function: Setup serial connection
1100      * @param fd File descriptor of serial tty device
1101      * @param speed Serial line speed, as defined in termios.h
1102      * @return negative value if there was an error
1103      */
1104     int dlt_setup_serial(int fd, speed_t speed);
1105
1106     /**
1107      * Helper function: Convert serial line baudrate (as number) to line speed (as defined in termios.h)
1108      * @param baudrate Serial line baudrate (as number)
1109      * @return Serial line speed, as defined in termios.h
1110      */
1111     speed_t dlt_convert_serial_speed(int baudrate);
1112
1113     /**
1114      * Print dlt version and dlt svn version to buffer
1115      * @param buf Pointer to buffer
1116      */
1117     void dlt_get_version(char *buf);
1118
1119     /**
1120     * Print dlt major version to buffer
1121     * @param buf Pointer to buffer
1122     */
1123     void dlt_get_major_version(char *buf);
1124
1125     /**
1126     * Print dlt minor version to buffer
1127     * @param buf Pointer to buffer
1128     */
1129     void dlt_get_minor_version(char *buf);
1130
1131 #endif
1132
1133     /* Function prototypes which should be used only internally */
1134     /*                                                          */
1135
1136     /**
1137      * Common part of initialisation
1138      * @return negative value if there was an error
1139      */
1140     int dlt_init_common(void);
1141
1142     /**
1143      * Return the uptime of the system in 0.1 ms resolution
1144      * @return 0 if there was an error
1145      */
1146     uint32_t dlt_uptime(void);
1147
1148     /**
1149      * Print header of a DLT message
1150      * @param message pointer to structure of organising access to DLT messages
1151      * @param text pointer to a ASCII string, in which the header is written
1152      * @param size maximal size of text buffer
1153      * @param verbose if set to true verbose information is printed out.
1154      * @return negative value if there was an error
1155      */
1156     int dlt_message_print_header(DltMessage *message, char *text, uint32_t size, int verbose);
1157
1158     /**
1159      * Print payload of a DLT message as Hex-Output
1160      * @param message pointer to structure of organising access to DLT messages
1161      * @param text pointer to a ASCII string, in which the output is written
1162      * @param size maximal size of text buffer
1163      * @param verbose if set to true verbose information is printed out.
1164      * @return negative value if there was an error
1165      */
1166     int dlt_message_print_hex(DltMessage *message, char *text, uint32_t size, int verbose);
1167
1168     /**
1169      * Print payload of a DLT message as ASCII-Output
1170      * @param message pointer to structure of organising access to DLT messages
1171      * @param text pointer to a ASCII string, in which the output is written
1172      * @param size maximal size of text buffer
1173      * @param verbose if set to true verbose information is printed out.
1174      * @return negative value if there was an error
1175      */
1176     int dlt_message_print_ascii(DltMessage *message, char *text, uint32_t size, int verbose);
1177
1178     /**
1179      * Print payload of a DLT message as Mixed-Ouput (Hex and ASCII), for plain text output
1180      * @param message pointer to structure of organising access to DLT messages
1181      * @param text pointer to a ASCII string, in which the output is written
1182      * @param size maximal size of text buffer
1183      * @param verbose if set to true verbose information is printed out.
1184      * @return negative value if there was an error
1185      */
1186     int dlt_message_print_mixed_plain(DltMessage *message, char *text, uint32_t size, int verbose);
1187
1188     /**
1189      * Print payload of a DLT message as Mixed-Ouput (Hex and ASCII), for HTML text output
1190      * @param message pointer to structure of organising access to DLT messages
1191      * @param text pointer to a ASCII string, in which the output is written
1192      * @param size maximal size of text buffer
1193      * @param verbose if set to true verbose information is printed out.
1194      * @return negative value if there was an error
1195      */
1196     int dlt_message_print_mixed_html(DltMessage *message, char *text, uint32_t size, int verbose);
1197
1198     /**
1199      * Decode and print a argument of a DLT message
1200      * @param msg pointer to structure of organising access to DLT messages
1201      * @param type_info Type of argument
1202      * @param ptr pointer to pointer to data (pointer to data is changed within this function)
1203      * @param datalength pointer to datalength (datalength is changed within this function)
1204      * @param text pointer to a ASCII string, in which the output is written
1205      * @param textlength maximal size of text buffer
1206      * @param byteLength If argument is a string, and this value is 0 or greater, this value will be taken as string length
1207      * @param verbose if set to true verbose information is printed out.
1208      * @return negative value if there was an error
1209      */
1210     int dlt_message_argument_print(DltMessage *msg,uint32_t type_info,uint8_t **ptr,int32_t *datalength,char *text,int textlength,int byteLength,int verbose);
1211
1212 #ifdef __cplusplus
1213 }
1214 #endif
1215
1216 /**
1217   \}
1218 */
1219
1220 #endif /* DLT_COMMON_H */