Bug Summary

File:builds/wireshark/wireshark/wiretap/cllog.c
Warning:line 477, column 33
Addition of a null pointer (from variable 'pFieldEnd') and a nonzero integer value results in undefined behavior

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name cllog.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -fno-delete-null-pointer-checks -mframe-pointer=all -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -ffloat16-excess-precision=fast -fbfloat16-excess-precision=fast -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/builds/wireshark/wireshark/build -fcoverage-compilation-dir=/builds/wireshark/wireshark/build -resource-dir /usr/lib/llvm-22/lib/clang/22 -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /usr/include/libxml2 -D CARES_NO_DEPRECATED -D G_DISABLE_DEPRECATED -D G_DISABLE_SINGLE_INCLUDES -D WS_BUILD_DLL -D WS_DEBUG -D WS_DEBUG_UTF_8 -D wiretap_EXPORTS -I /builds/wireshark/wireshark/build -I /builds/wireshark/wireshark -I /builds/wireshark/wireshark/include -I /builds/wireshark/wireshark/wiretap -I /builds/wireshark/wireshark/build/wiretap -D _GLIBCXX_ASSERTIONS -internal-isystem /usr/lib/llvm-22/lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/builds/wireshark/wireshark/= -fmacro-prefix-map=/builds/wireshark/wireshark/build/= -fmacro-prefix-map=../= -Wno-format-nonliteral -std=gnu17 -ferror-limit 19 -fvisibility=hidden -fwrapv -fwrapv-pointer -fstrict-flex-arrays=3 -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fexceptions -fcolor-diagnostics -analyzer-output=html -faddrsig -fdwarf2-cfi-asm -o /builds/wireshark/wireshark/sbout/2026-11-28-100325-3662-1 -x c /builds/wireshark/wireshark/wiretap/cllog.c
1/* cllog.c
2 *
3 * Wiretap Library
4 * Copyright (c) 1998 by Gilbert Ramirez <[email protected]>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9/*
10 * Reads log files from CLX000 CAN loggers from CSS Electronics:
11 *
12 * https://canlogger.csselectronics.com/clx000-docs/cl1000/log/index.html
13 * https://canlogger.csselectronics.com/clx000-docs/cl2000/log/index.html
14 *
15 * Based on the cCLLog.c, cCLLog.h, and wtap-cllog.c source files from
16 * the WS_v2.4-Plugin_v7.1.zip version of the CSS Electronics plugin at
17 *
18 * https://canlogger.csselectronics.com/downloads.php?q=wireshark
19 *
20 * with the files combined into one source file, modernized to
21 * fit into an up-to-date version of Wireshark, and cleaned up
22 * not to, for example, do seeks by rewinding and reading to
23 * get to the seek target.
24 *
25 * It could probably use some further cleanup.
26 */
27
28#include "config.h"
29
30#include <stdio.h>
31#include <stdbool.h>
32#include <stdint.h>
33#include <string.h>
34#include <stdlib.h>
35#include <time.h>
36
37#include <wsutil/array.h>
38#include <wsutil/str_util.h>
39#include <wsutil/strtoi.h>
40
41#include "socketcan.h"
42#include "file_wrappers.h"
43#include "cllog.h"
44
45static int cllog_file_type_subtype = -1;
46
47/***********************************************************************************************************************
48 * Public definitions
49 **********************************************************************************************************************/
50#define MAX_LOG_LINE_FIELDS7 7 /*( seqNo, timestamp, lost, SE, ID, length, data) */
51/***********************************************************************************************************************
52 * Public type declarations
53 **********************************************************************************************************************/
54
55 /* Message type */
56typedef enum
57{
58 msg_rx_standard_e = 0,
59 msg_rx_extended_e = 1,
60 msg_tx_standard_e = 7,
61 msg_tx_extended_e = 8,
62} cCLLog_messageType_t;
63
64/* Typedef CAN-bus message type */
65typedef struct
66{
67 uint32_t lost;
68 cCLLog_messageType_t msgType;
69 wtap_can_msg_t msg;
70} cCLLog_message_t;
71
72/* Silent-mode*/
73typedef enum { silent_disabled_e = 0, silent_enabled_e } cCLLog_silentMode_t;
74
75/* Cyclic-mode*/
76typedef enum { cyclic_disabled_e = 0, cyclic_enabled_e } cCLLog_cyclicMode_t;
77
78/* Logger type */
79typedef enum { type_CL1000_e = 0, type_CL2000_e, type_CL3000_e } cCLLog_loggerType_t;
80
81typedef char * (*CLLog_gets_t)(char *s, int size, void *stream);
82typedef int (*CLLog_rewind_t)(void *stream);
83
84typedef struct cLLog_private cCLLog_logFileInfo_t;
85
86/* Type used to parse a field in a log line */
87typedef bool_Bool (*parseFieldFunc_t)(cCLLog_logFileInfo_t *pInfo, char *pField, cCLLog_message_t *pLogEntry, int *err, char **err_info);
88
89/* Log file information */
90struct cLLog_private
91{
92 uint32_t firstLogRow;
93 cCLLog_loggerType_t loggerType;
94 char hwrev[5];
95 char fwrev[5];
96 char id[20];
97 uint32_t sessionNo;
98 uint32_t splitNo;
99 nstime_t logStartTime;
100 char logStartTimeString[ 20 ];
101 char separator;
102 uint8_t timeFormat;
103 char timeSeparator;
104 char timeSeparatorMs;
105 char dateSeparator;
106 char dateAndTimeSeparator;
107 uint32_t bitRate;
108 cCLLog_silentMode_t silentMode;
109 cCLLog_cyclicMode_t cyclicMode;
110
111 parseFieldFunc_t parseFieldFunc[ MAX_LOG_LINE_FIELDS7 ];
112
113 /* First log time stamp as relative offset */
114 nstime_t firstTimeStampAbs;
115};
116
117/***********************************************************************************************************************
118 * Private definitions
119 **********************************************************************************************************************/
120#define HEADER_LINE_PARSE_MAPPING_LENGTH(sizeof (headerLineParseMapping) / sizeof (headerLineParseMapping
)[0])
array_length(headerLineParseMapping)(sizeof (headerLineParseMapping) / sizeof (headerLineParseMapping
)[0])
121#define MAX_LOG_LINE_LENGTH200 200
122#define TIME_STAMP_STRING_MAX_LENGTH( sizeof( "YYYY/MM/DDThh:mm:ss.kkk" ) ) ( sizeof( "YYYY/MM/DDThh:mm:ss.kkk" ) )
123#define TIME_STAMP_STRING_STRIPPED_MAX_LENGTH( sizeof( "YYYYMMDDhhmmsskkk" ) ) ( sizeof( "YYYYMMDDhhmmsskkk" ) )
124
125/***********************************************************************************************************************
126 * Private type definitions
127 **********************************************************************************************************************/
128/* Function type to parse a single log file line */
129typedef bool_Bool (*parseFunc_t)(cCLLog_logFileInfo_t *pInfo, char *pLine, int *err, char **err_info);
130
131/* Structure of the header parse mapping. A match string is paired with a parse function */
132typedef struct
133{
134 const char *pMatchString;
135 parseFunc_t parseFunc;
136} headerLineParseMapping_t;
137
138/***********************************************************************************************************************
139 * Private function declarations
140 **********************************************************************************************************************/
141static bool_Bool parseColumnHeaderFields( cCLLog_logFileInfo_t *pInfo, char *pColLine );
142static uint8_t stripTimeStamp( const cCLLog_logFileInfo_t *pInfo, char *pTimeStampString );
143
144/* Parse header lines functions */
145static bool_Bool parseLogFileHeaderLine_type(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
146static bool_Bool parseLogFileHeaderLine_hwrev(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
147static bool_Bool parseLogFileHeaderLine_fwrev(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
148static bool_Bool parseLogFileHeaderLine_id(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
149static bool_Bool parseLogFileHeaderLine_sessionNo(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
150static bool_Bool parseLogFileHeaderLine_splitNo(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
151static bool_Bool parseLogFileHeaderLine_time(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
152static bool_Bool parseLogFileHeaderLine_valueSeparator(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
153static bool_Bool parseLogFileHeaderLine_timeFormat(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
154static bool_Bool parseLogFileHeaderLine_timeSeparator(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
155static bool_Bool parseLogFileHeaderLine_timeSeparatorMs(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
156static bool_Bool parseLogFileHeaderLine_dateSeparator(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
157static bool_Bool parseLogFileHeaderLine_timeAndDateSeparator(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
158static bool_Bool parseLogFileHeaderLine_bitRate(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
159static bool_Bool parseLogFileHeaderLine_silentMode(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
160static bool_Bool parseLogFileHeaderLine_cyclicMode(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info);
161/***********************************************************************************************************************
162 * Private variable definitions
163 **********************************************************************************************************************/
164
165/* Array of header line match strings and associated parse functions */
166static const headerLineParseMapping_t headerLineParseMapping[] =
167{
168 { .pMatchString = "Logger type: ", .parseFunc = parseLogFileHeaderLine_type},
169 { .pMatchString = "HW rev: ", .parseFunc = parseLogFileHeaderLine_hwrev },
170 { .pMatchString = "FW rev: ", .parseFunc = parseLogFileHeaderLine_fwrev },
171 { .pMatchString = "Logger ID: ", .parseFunc = parseLogFileHeaderLine_id},
172 { .pMatchString = "Session No.: ", .parseFunc = parseLogFileHeaderLine_sessionNo},
173 { .pMatchString = "Split No.: ", .parseFunc = parseLogFileHeaderLine_splitNo},
174 { .pMatchString = "Time: ", .parseFunc = parseLogFileHeaderLine_time},
175 { .pMatchString = "Value separator: ", .parseFunc = parseLogFileHeaderLine_valueSeparator},
176 { .pMatchString = "Time format: ", .parseFunc = parseLogFileHeaderLine_timeFormat},
177 { .pMatchString = "Time separator: ", .parseFunc = parseLogFileHeaderLine_timeSeparator},
178 { .pMatchString = "Time separator ms: ", .parseFunc = parseLogFileHeaderLine_timeSeparatorMs},
179 { .pMatchString = "Date separator: ", .parseFunc = parseLogFileHeaderLine_dateSeparator},
180 { .pMatchString = "Time and date separator: ", .parseFunc = parseLogFileHeaderLine_timeAndDateSeparator},
181 { .pMatchString = "Bit-rate: ", .parseFunc = parseLogFileHeaderLine_bitRate},
182 { .pMatchString = "Silent mode: ", .parseFunc = parseLogFileHeaderLine_silentMode},
183 { .pMatchString = "Cyclic mode: ", .parseFunc = parseLogFileHeaderLine_cyclicMode},
184};
185
186/*
187 * Do a string copy to a buffer of a specified length.
188 * If the string will fit, return true.
189 * If the string won't fit, return false.
190 */
191static bool_Bool
192checked_strcpy(char *dest, size_t destlen, const char *src)
193{
194 size_t srclen;
195
196 srclen = strlen(src) + 1; // count the trailing '\0'
197 if (srclen > destlen)
198 return false0;
199 memcpy(dest, src, srclen);
200 return true1;
201}
202
203/* TODO: Does not support separators set to numbers (will remove part of the time stamp also */
204/* TODO: Does not support time stamps without ms, as given in the header */
205/* TODO: Alot of copying slows down the parsing */
206static bool_Bool parseFieldTS(cCLLog_logFileInfo_t *pInfo, char *pField, cCLLog_message_t *pLogEntry, int *err, char **err_info)
207{
208 struct tm tm;
209 int ms;
210
211 /* Copy the string to not modify the original */
212 char timeStampCopy[TIME_STAMP_STRING_MAX_LENGTH( sizeof( "YYYY/MM/DDThh:mm:ss.kkk" ) )];
213 if (!checked_strcpy(timeStampCopy, sizeof timeStampCopy, pField))
214 {
215 *err = WTAP_ERR_BAD_FILE-13;
216 *err_info = g_strdup("cllog: time stamp is too long")g_strdup_inline ("cllog: time stamp is too long");
217 return false0;
218 }
219
220 /* Copy the header time stamp string to not modify the original */
221 char timeStampHeaderCopy[TIME_STAMP_STRING_MAX_LENGTH( sizeof( "YYYY/MM/DDThh:mm:ss.kkk" ) )];
222 if (!checked_strcpy(timeStampHeaderCopy, sizeof timeStampHeaderCopy, pInfo->logStartTimeString))
223 {
224 *err = WTAP_ERR_BAD_FILE-13;
225 *err_info = g_strdup("cllog: header time stamp too long")g_strdup_inline ("cllog: header time stamp too long");
226 return false0;
227 }
228
229 /* Strip the delimiters from the time strings */
230 uint8_t msgTimeStrippedLen = stripTimeStamp(pInfo, timeStampCopy);
231 if (msgTimeStrippedLen > TIME_STAMP_STRING_STRIPPED_MAX_LENGTH( sizeof( "YYYYMMDDhhmmsskkk" ) ) - 1) {
232 *err = WTAP_ERR_BAD_FILE-13;
233 *err_info = g_strdup("cllog: time stamp incorrectly formatted")g_strdup_inline ("cllog: time stamp incorrectly formatted");
234 return false0;
235 }
236
237 uint8_t headerTimeStrippedLen = stripTimeStamp(pInfo, timeStampHeaderCopy);
238 if (headerTimeStrippedLen > TIME_STAMP_STRING_STRIPPED_MAX_LENGTH( sizeof( "YYYYMMDDhhmmsskkk" ) ) - 1) {
239 *err = WTAP_ERR_BAD_FILE-13;
240 *err_info = g_strdup("cllog: header time stamp incorrectly formatted")g_strdup_inline ("cllog: header time stamp incorrectly formatted"
)
;
241 return false0;
242 }
243
244 /* Set time string (YYYYMMDDhhmmsskkk) to the epoch */
245 char timeStampStringFull[TIME_STAMP_STRING_STRIPPED_MAX_LENGTH( sizeof( "YYYYMMDDhhmmsskkk" ) )] = "19700101000000000";
246
247 /* Copy the header time to the template */
248 memcpy(timeStampStringFull, timeStampHeaderCopy, headerTimeStrippedLen);
249
250 /* Copy the stripped timestamp into the full template */
251 memcpy(&timeStampStringFull[TIME_STAMP_STRING_STRIPPED_MAX_LENGTH( sizeof( "YYYYMMDDhhmmsskkk" ) ) - 1 - msgTimeStrippedLen], timeStampCopy, msgTimeStrippedLen);
252 timeStampStringFull[TIME_STAMP_STRING_STRIPPED_MAX_LENGTH( sizeof( "YYYYMMDDhhmmsskkk" ) ) - 1] = '\0';
253
254 memset(&tm, 0, sizeof tm);
255
256 /* YYYYMMDDThhmmss */
257 if (sscanf(timeStampStringFull, "%4u%2u%2u%2u%2u%2u%3d",
258 &tm.tm_year,
259 &tm.tm_mon,
260 &tm.tm_mday,
261 &tm.tm_hour,
262 &tm.tm_min,
263 &tm.tm_sec,
264 &ms
265 ) != 7) {
266 *err = WTAP_ERR_BAD_FILE-13;
267 *err_info = g_strdup("cllog: time stamp is not valid")g_strdup_inline ("cllog: time stamp is not valid");
268 return false0;
269 }
270 tm.tm_mon -= 1;
271 tm.tm_year -= 1900;
272
273 /* To Epoch (mktime converts to epoch from local (!!!) timezone) */
274 pLogEntry->msg.ts.secs = mktime(&tm);
275 pLogEntry->msg.ts.nsecs = ms*1000 * 1000;
276
277 /* Is first time stamp ? */
278 if (pInfo->firstTimeStampAbs.secs == 0 && pInfo->firstTimeStampAbs.nsecs == 0)
279 pInfo->firstTimeStampAbs = pLogEntry->msg.ts;
280
281 return true1;
282}
283
284static bool_Bool parseFieldLost(cCLLog_logFileInfo_t *pInfo _U___attribute__((unused)), char *pField, cCLLog_message_t *pLogEntry, int *err, char **err_info)
285{
286 uint32_t lost;
287
288 if (!ws_strtou32(pField, NULL((void*)0), &lost)) {
289 *err = WTAP_ERR_BAD_FILE-13;
290 *err_info = g_strdup_printf("cllog: lost packet count value is not valid");
291 return false0;
292 }
293 pLogEntry->lost = lost;
294 return true1;
295}
296
297static bool_Bool parseFieldMsgType(cCLLog_logFileInfo_t *pInfo _U___attribute__((unused)), char *pField, cCLLog_message_t *pLogEntry, int *err, char **err_info)
298{
299 switch (pField[0])
300 {
301 case '0':
302 pLogEntry->msgType = msg_rx_standard_e;
303 pLogEntry->msg.type = MSG_TYPE_STD;
304 return true1;
305 case '1':
306 pLogEntry->msgType = msg_rx_extended_e;
307 pLogEntry->msg.type = MSG_TYPE_EXT;
308 return true1;
309 case '8':
310 pLogEntry->msgType = msg_tx_standard_e;
311 pLogEntry->msg.type = MSG_TYPE_STD;
312 return true1;
313 case '9':
314 pLogEntry->msgType = msg_tx_extended_e;
315 pLogEntry->msg.type = MSG_TYPE_EXT;
316 return true1;
317 default:
318 *err = WTAP_ERR_BAD_FILE-13;
319 *err_info = g_strdup("cllog: unknown message type")g_strdup_inline ("cllog: unknown message type");
320 return false0;
321 }
322}
323
324static bool_Bool parseFieldID(cCLLog_logFileInfo_t *pInfo _U___attribute__((unused)), char *pField, cCLLog_message_t *pLogEntry, int *err, char **err_info)
325{
326 uint32_t id;
327
328 if (!ws_hexstrtou32(pField, NULL((void*)0), &id)) {
329 *err = WTAP_ERR_BAD_FILE-13;
330 *err_info = g_strdup_printf("cllog: ID value is not valid");
331 return false0;
332 }
333 pLogEntry->msg.id = id;
334 return true1;
335}
336
337static bool_Bool parseFieldLength(cCLLog_logFileInfo_t *pInfo _U___attribute__((unused)), char *pField, cCLLog_message_t *pLogEntry, int *err, char **err_info)
338{
339 uint32_t length;
340
341 if (!ws_strtou32(pField, NULL((void*)0), &length)) {
342 *err = WTAP_ERR_BAD_FILE-13;
343 *err_info = g_strdup_printf("cllog: length value is not valid");
344 return false0;
345 }
346 if (length > array_length(pLogEntry->msg.data.data)(sizeof (pLogEntry->msg.data.data) / sizeof (pLogEntry->
msg.data.data)[0])
) {
347 *err = WTAP_ERR_BAD_FILE-13;
348 *err_info = g_strdup_printf("cllog: length value %u > maximum length %zu",
349 length, array_length(pLogEntry->msg.data.data)(sizeof (pLogEntry->msg.data.data) / sizeof (pLogEntry->
msg.data.data)[0])
);
350 return false0;
351 }
352 pLogEntry->msg.data.length = length;
353 return true1;
354}
355
356static bool_Bool parseFieldData(cCLLog_logFileInfo_t *pInfo _U___attribute__((unused)), char *pField, cCLLog_message_t *pLogEntry, int *err, char **err_info)
357{
358 char *pFieldStart = pField;
359
360 /* Set data length in case length field is not set explicitly in the log file */
361 pLogEntry->msg.data.length = 0;
362
363 /* Loop all data bytes */
364 while (pLogEntry->msg.data.length < array_length(pLogEntry->msg.data.data)(sizeof (pLogEntry->msg.data.data) / sizeof (pLogEntry->
msg.data.data)[0])
)
365 {
366 int hexdigit;
367 uint8_t data;
368
369 if (*pFieldStart == '\n' || *pFieldStart == '\r' || *pFieldStart == '\0')
370 {
371 break;
372 }
373
374 hexdigit = ws_xton(*pFieldStart);
375 if (hexdigit < 0) {
376 *err = WTAP_ERR_BAD_FILE-13;
377 *err_info = g_strdup_printf("cllog: packet byte value 0x%02x is not valid", *pFieldStart);
378 return false0;
379 }
380 data = (uint8_t)hexdigit << 4U;
381 pFieldStart++;
382 hexdigit = ws_xton(*pFieldStart);
383 if (hexdigit < 0) {
384 *err = WTAP_ERR_BAD_FILE-13;
385 *err_info = g_strdup_printf("cllog: packet byte value 0x%02x is not valid", *pFieldStart);
386 return false0;
387 }
388 data = data | (uint8_t)hexdigit;
389 pFieldStart++;
390 pLogEntry->msg.data.data[pLogEntry->msg.data.length++] = data;
391 }
392 return true1;
393}
394
395static bool_Bool parseLogLine(cCLLog_logFileInfo_t *pInfo, char *pLine, cCLLog_message_t *pLogEntry, int *err, char **err_info)
396{
397 char *pFieldStart = pLine;
398
399 /* Loop all fields in log line */
400 for (unsigned int fieldNo = 0, finalField = 0; fieldNo < MAX_LOG_LINE_FIELDS7 && finalField == 0; fieldNo++)
401 {
402 /* Find field end by separator */
403 char *pFieldEnd = strchr(pFieldStart, pInfo->separator);
404
405 /* If final field, then EOL marks the end of the field */
406 if (pFieldEnd == NULL((void*)0))
407 {
408 pFieldEnd = strchr(pFieldStart, '\n');
409 finalField = 1;
410 }
411
412 /* Replace separator or terminator with string termination */
413 if (pFieldEnd != NULL((void*)0))
414 {
415 *pFieldEnd = '\0';
416 }
417
418 /* Is parse function assigned to field? */
419 if (pInfo->parseFieldFunc[fieldNo] != NULL((void*)0))
420 {
421 /* Parse field */
422 if (!pInfo->parseFieldFunc[fieldNo](pInfo, pFieldStart, pLogEntry, err, err_info))
423 {
424 return false0;
425 }
426 }
427
428 /* Skip over the separator */
429 pFieldStart = pFieldEnd + 1;
430 }
431 return true1;
432}
433
434/***********************************************************************************************************************
435 * parseColumnHeaderFields
436 *
437 * Parse the column fields and determine which fields are present and the position of the fields
438 *
439 * @param[ in ] pInfo Pointer to the CLLog object
440 * @param[ in ] pColLine The column line
441 **********************************************************************************************************************/
442static bool_Bool parseColumnHeaderFields( cCLLog_logFileInfo_t *pInfo, char *pColLine )
443{
444 bool_Bool resultFlag = false0;
445
446 /* Initialise field start */
447 char *pFieldStart = pColLine;
448
449 /* Loop all fields in line */
450 for ( uint8_t fieldNo = 0, finalField = 0 ; fieldNo
0.1
'fieldNo' is < MAX_LOG_LINE_FIELDS
< MAX_LOG_LINE_FIELDS7 && finalField == 0 ; fieldNo++ )
1
Loop condition is true. Entering loop body
451 {
452 /* Find field end */
453 char *pFieldEnd = strchr( pFieldStart, pInfo->separator );
454
455 /* If final field, then EOL marks the end of the field */
456 if( pFieldEnd == NULL((void*)0) )
2
Assuming 'pFieldEnd' is equal to NULL
3
Taking true branch
457 {
458 pFieldEnd = strchr( pFieldStart, '\n' );
4
Value assigned to 'pFieldEnd'
459 finalField = 1;
460 }
461
462 /* Replace separator or terminator with string termination */
463 if (pFieldEnd != NULL((void*)0))
5
Assuming 'pFieldEnd' is equal to NULL
6
Taking false branch
464 {
465 *pFieldEnd = '\0';
466 }
467
468 /* Set field number */
469 if( strcmp( pFieldStart, "Timestamp" ) == 0 ) { pInfo->parseFieldFunc[ fieldNo ] = parseFieldTS; resultFlag = true1; }
7
Assuming the condition is false
8
Taking false branch
470 if( strcmp( pFieldStart, "Lost" ) == 0 ) { pInfo->parseFieldFunc[ fieldNo ] = parseFieldLost; resultFlag = true1; }
9
Assuming the condition is false
10
Taking false branch
471 if( strcmp( pFieldStart, "Type" ) == 0 ) { pInfo->parseFieldFunc[ fieldNo ] = parseFieldMsgType; resultFlag = true1; }
11
Assuming the condition is false
12
Taking false branch
472 if( strcmp( pFieldStart, "ID" ) == 0 ) { pInfo->parseFieldFunc[ fieldNo ] = parseFieldID; resultFlag = true1; }
13
Assuming the condition is false
14
Taking false branch
473 if( strcmp( pFieldStart, "Length" ) == 0 ) { pInfo->parseFieldFunc[ fieldNo ] = parseFieldLength; resultFlag = true1; }
15
Assuming the condition is false
16
Taking false branch
474 if( strcmp( pFieldStart, "Data" ) == 0 ) { pInfo->parseFieldFunc[ fieldNo ] = parseFieldData; resultFlag = true1; }
17
Assuming the condition is false
18
Taking false branch
475
476 /* Set start of next field to end of previous + 1 */
477 pFieldStart = pFieldEnd + 1;
19
Addition of a null pointer (from variable 'pFieldEnd') and a nonzero integer value results in undefined behavior
478 }
479
480 return resultFlag;
481}
482
483/***********************************************************************************************************************
484 * stripTimeStamp
485 *
486 * Strips a time stamp string for any delimiters
487 **********************************************************************************************************************/
488static uint8_t stripTimeStamp( const cCLLog_logFileInfo_t *pInfo, char *pTimeStampString )
489{
490 uint8_t strippedLength = 0U;
491
492 /* Char by char, strip the delimiters from the time stamp string */
493 size_t timeStampStringLen = strlen( pTimeStampString );
494 for (size_t i = 0U; i < timeStampStringLen; i++ )
495 {
496 /* Get char */
497 char charTmp = pTimeStampString[i];
498
499 /* If delimiter, skip */
500 if( charTmp == pInfo->separator ){ continue; }
501 if( charTmp == pInfo->timeSeparator ){ continue; }
502 if( charTmp == pInfo->timeSeparatorMs ){ continue; }
503 if( charTmp == pInfo->dateSeparator ){ continue; }
504 if( charTmp == pInfo->dateAndTimeSeparator ){ continue; }
505
506 /* Not a delimiter, keep char */
507 pTimeStampString[ strippedLength++ ] = charTmp;
508 }
509 pTimeStampString[ strippedLength ] = '\0';
510
511 return strippedLength;
512}
513
514static bool_Bool parseString(const char *pFieldValue, char *valuep, size_t valueSize, char *fieldName, int *err, char **err_info)
515{
516 if (!checked_strcpy(valuep, valueSize, pFieldValue))
517 {
518 *err = WTAP_ERR_BAD_FILE-13;
519 *err_info = ws_strdup_printf("cllog: %s is too long",wmem_strdup_printf(((void*)0), "cllog: %s is too long", fieldName
)
520 fieldName)wmem_strdup_printf(((void*)0), "cllog: %s is too long", fieldName
)
;
521 return false0;
522 }
523 return true1;
524}
525
526static bool_Bool parseUnsigned(const char *pFieldValue, uint32_t *valuep, char *fieldName, int *err, char **err_info)
527{
528 uint32_t value;
529
530 if (!ws_strtou32(pFieldValue, NULL((void*)0), &value)) {
531 *err = WTAP_ERR_BAD_FILE-13;
532 *err_info = ws_strdup_printf("cllog: %s value is not valid",wmem_strdup_printf(((void*)0), "cllog: %s value is not valid"
, fieldName)
533 fieldName)wmem_strdup_printf(((void*)0), "cllog: %s value is not valid"
, fieldName)
;
534 return false0;
535 }
536 *valuep = value;
537 return true1;
538}
539
540static bool_Bool parseSeparator(const char *pFieldValue, char *separatorp, char *fieldName, int *err, char **err_info)
541{
542 char separator = '\0';
543
544 /* Separator field is if set e.g. ";" - that is 3 chars. Else it is "" */
545 if (strlen( pFieldValue) == 3)
546 {
547 if (pFieldValue[0] != '"' || !g_ascii_isprint(pFieldValue[1])((g_ascii_table[(guchar) (pFieldValue[1])] & G_ASCII_PRINT
) != 0)
||
548 pFieldValue[2] != '"')
549 {
550 *err = WTAP_ERR_BAD_FILE-13;
551 *err_info = ws_strdup_printf("cllog: %s separator is not valid",wmem_strdup_printf(((void*)0), "cllog: %s separator is not valid"
, fieldName)
552 fieldName)wmem_strdup_printf(((void*)0), "cllog: %s separator is not valid"
, fieldName)
;
553 return false0;
554 }
555 separator = pFieldValue[1];
556 }
557 *separatorp = separator;
558 return true1;
559}
560
561static bool_Bool parseBoolean(const char *pFieldValue, bool_Bool *value, char *fieldName, int *err, char **err_info)
562{
563 if (strcmp(pFieldValue, "true") == 0)
564 {
565 *value = true1;
566 }
567 else if (strcmp(pFieldValue, "false") == 0)
568 {
569 *value = false0;
570 }
571 else
572 {
573 *err = WTAP_ERR_BAD_FILE-13;
574 *err_info = ws_strdup_printf("cllog: %s value is not valid",wmem_strdup_printf(((void*)0), "cllog: %s value is not valid"
, fieldName)
575 fieldName)wmem_strdup_printf(((void*)0), "cllog: %s value is not valid"
, fieldName)
;
576 return false0;
577 }
578 return true1;
579}
580
581static bool_Bool parseLogFileHeaderLine_type(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
582{
583 if (strcmp(pFieldValue, "CANLogger1000") == 0 || strcmp(pFieldValue, "CL1000") == 0)
584 {
585 pInfo->loggerType = type_CL1000_e;
586 }
587 else if (strcmp(pFieldValue, "CANLogger2000") == 0 || strcmp(pFieldValue, "CL2000") == 0)
588 {
589 pInfo->loggerType = type_CL2000_e;
590 }
591 else if (strcmp(pFieldValue, "CANLogger3000") == 0 || strcmp(pFieldValue, "CL3000") == 0)
592 {
593 pInfo->loggerType = type_CL3000_e;
594 }
595 else
596 {
597 *err = WTAP_ERR_BAD_FILE-13;
598 *err_info = g_strdup("cllog: logger type value is not valid")g_strdup_inline ("cllog: logger type value is not valid");
599 return false0;
600 }
601 return true1;
602}
603
604static bool_Bool parseLogFileHeaderLine_hwrev(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
605{
606 return parseString(pFieldValue, pInfo->hwrev, sizeof pInfo->hwrev, "hardware revision", err, err_info);
607}
608
609static bool_Bool parseLogFileHeaderLine_fwrev(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
610{
611 return parseString(pFieldValue, pInfo->fwrev, sizeof pInfo->fwrev, "firmware revision", err, err_info);
612}
613
614static bool_Bool parseLogFileHeaderLine_id(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
615{
616 return parseString(pFieldValue, pInfo->id, sizeof pInfo->id, "ID", err, err_info);
617}
618
619static bool_Bool parseLogFileHeaderLine_sessionNo(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
620{
621 return parseUnsigned(pFieldValue, &pInfo->sessionNo, "session number", err, err_info);
622}
623
624static bool_Bool parseLogFileHeaderLine_splitNo(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
625{
626 return parseUnsigned(pFieldValue, &pInfo->splitNo, "split number", err, err_info);
627}
628
629static bool_Bool parseLogFileHeaderLine_time(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
630{
631 struct tm tm;
632
633 memset(&tm, 0, sizeof tm);
634 /* YYYYMMDDThhmmss */
635 sscanf(pFieldValue,
636 "%4u%2u%2uT%2u%2u%2u",
637 &tm.tm_year,
638 &tm.tm_mon,
639 &tm.tm_mday,
640 &tm.tm_hour,
641 &tm.tm_min,
642 &tm.tm_sec);
643 tm.tm_mon -= 1;
644 tm.tm_year -= 1900;
645
646 /* To Epoch ( mktime converts to epoch from local (!!!) timezone )*/
647 pInfo->logStartTime.secs = mktime(&tm);
648 pInfo->logStartTime.nsecs = 0;
649
650 if (!checked_strcpy(pInfo->logStartTimeString, sizeof pInfo->logStartTimeString, pFieldValue))
651 {
652 *err = WTAP_ERR_BAD_FILE-13;
653 *err_info = g_strdup("cllog: time is too long")g_strdup_inline ("cllog: time is too long");
654 return false0;
655 }
656 return true1;
657}
658
659static bool_Bool parseLogFileHeaderLine_valueSeparator(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
660{
661 return parseSeparator(pFieldValue, &pInfo->separator, "value", err, err_info);
662}
663
664static bool_Bool parseLogFileHeaderLine_timeFormat(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
665{
666 uint32_t format;
667
668 if (!ws_strtou32(pFieldValue, NULL((void*)0), &format))
669 {
670 *err = WTAP_ERR_BAD_FILE-13;
671 *err_info = g_strdup("cllog: time format value is not valid")g_strdup_inline ("cllog: time format value is not valid");
672 return false0;
673 }
674 if (format > 6)
675 {
676 *err = WTAP_ERR_BAD_FILE-13;
677 *err_info = g_strdup("cllog: time format value is not valid")g_strdup_inline ("cllog: time format value is not valid");
678 return false0;
679 }
680 pInfo->timeFormat = (uint8_t)format;
681 return true1;
682}
683
684static bool_Bool parseLogFileHeaderLine_timeSeparator(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
685{
686 return parseSeparator(pFieldValue, &pInfo->timeSeparator, "time", err, err_info);
687}
688
689static bool_Bool parseLogFileHeaderLine_timeSeparatorMs(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
690{
691 return parseSeparator(pFieldValue, &pInfo->timeSeparatorMs, "time millisecond", err, err_info);
692}
693
694static bool_Bool parseLogFileHeaderLine_dateSeparator(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
695{
696 return parseSeparator(pFieldValue, &pInfo->dateSeparator, "date", err, err_info);
697}
698
699static bool_Bool parseLogFileHeaderLine_timeAndDateSeparator(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
700{
701 return parseSeparator(pFieldValue, &pInfo->dateAndTimeSeparator, "date and time", err, err_info);
702}
703
704static bool_Bool parseLogFileHeaderLine_bitRate(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
705{
706 return parseUnsigned(pFieldValue, &pInfo->bitRate, "bit rate", err, err_info);
707}
708
709static bool_Bool parseLogFileHeaderLine_silentMode(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
710{
711 bool_Bool silentMode;
712
713 if (!parseBoolean(pFieldValue, &silentMode, "silent mode", err, err_info))
714 {
715 return false0;
716 }
717
718 if (silentMode)
719 {
720 pInfo->silentMode = silent_enabled_e;
721 }
722 else
723 {
724 pInfo->silentMode = silent_disabled_e;
725 }
726 return true1;
727}
728
729static bool_Bool parseLogFileHeaderLine_cyclicMode(cCLLog_logFileInfo_t *pInfo, char *pFieldValue, int *err, char **err_info)
730{
731 bool_Bool cyclicMode;
732
733 if (!parseBoolean(pFieldValue, &cyclicMode, "silent mode", err, err_info))
734 {
735 return false0;
736 }
737
738 if (cyclicMode)
739 {
740 pInfo->cyclicMode = cyclic_enabled_e;
741 }
742 else
743 {
744 pInfo->cyclicMode = cyclic_disabled_e;
745 }
746 return true1;
747}
748
749static bool_Bool
750cllog_read_common(wtap *wth, FILE_T fh, wtap_rec *rec, int *err, char **err_info)
751{
752 cCLLog_logFileInfo_t* clLog = (cCLLog_logFileInfo_t*)wtap_socketcan_get_private_data(wth);
753 char line[MAX_LOG_LINE_LENGTH200];
754 cCLLog_message_t logEntry;
755
756 /* Read a line */
757 if (file_gets(line, sizeof(line), fh) == NULL((void*)0))
758 {
759 /* EOF or error. */
760 *err = file_error(fh, err_info);
761 return false0;
762 }
763
764 /* Default the log entry structure */
765 memset(&logEntry, 0, sizeof(logEntry));
766
767 /* Parse the line */
768 if (!parseLogLine(clLog, line, &logEntry, err, err_info))
769 {
770 return false0;
771 }
772
773 logEntry.msg.interface_id = wtap_socketcan_find_or_create_new_interface(wth, clLog->id);
774 if (!wtap_socketcan_gen_packet(wth, rec, &logEntry.msg, "cllog", err, err_info))
775 return false0;
776
777
778 if (logEntry.msgType == msg_tx_standard_e || logEntry.msgType == msg_tx_extended_e)
779 {
780 wtap_block_add_uint32_option(rec->block, OPT_PKT_FLAGS2, PACK_FLAGS_DIRECTION_OUTBOUND2);
781 }
782 else if (logEntry.msgType == msg_rx_standard_e || logEntry.msgType == msg_rx_extended_e)
783 {
784 wtap_block_add_uint32_option(rec->block, OPT_PKT_FLAGS2, PACK_FLAGS_DIRECTION_INBOUND1);
785 }
786
787 return true1;
788}
789
790static bool_Bool
791cllog_read(wtap *wth, wtap_rec *rec, int *err, char **err_info, int64_t *data_offset)
792{
793 *data_offset = file_tell(wth->fh);
794
795 return cllog_read_common(wth, wth->fh, rec, err, err_info);
796}
797
798static bool_Bool
799cllog_seek_read(wtap *wth, int64_t seek_off, wtap_rec *rec, int *err, char **err_info)
800{
801 if (file_seek(wth->random_fh, seek_off, SEEK_SET0, err) == -1)
802 return false0;
803
804 return cllog_read_common(wth, wth->random_fh, rec, err, err_info);
805}
806
807static void
808cllog_close(void* tap_data)
809{
810 /* Clean up the file information */
811 g_free((cCLLog_logFileInfo_t*)tap_data)(__builtin_object_size (((cCLLog_logFileInfo_t*)tap_data), 0)
!= ((size_t) - 1)) ? g_free_sized ((cCLLog_logFileInfo_t*)tap_data
, __builtin_object_size (((cCLLog_logFileInfo_t*)tap_data), 0
)) : (g_free) ((cCLLog_logFileInfo_t*)tap_data)
;
812}
813
814wtap_open_return_val
815cllog_open(wtap *wth, int *err, char **err_info)
816{
817 cCLLog_logFileInfo_t *clLog;
818 char line[ MAX_LOG_LINE_LENGTH200 ];
819 char *linep;
820 bool_Bool saw_header_line = false0;
821
822 clLog = g_new0(cCLLog_logFileInfo_t, 1)((cCLLog_logFileInfo_t *) g_malloc0_n ((1), sizeof (cCLLog_logFileInfo_t
)))
;
823
824 /*
825 * We're at the beginning of the file. The header is a set
826 * of comment lines, each beginning with a '#'. Read each line,
827 * stopping if we see a non-comment line, and parse each
828 * comment line; if any aren't valid, quit and indicate that
829 * this isn't a CLX log file.
830 */
831 while ((linep = file_gets(line, sizeof(line), wth->fh)) != NULL((void*)0) &&
832 linep[0] == '#')
833 {
834 /*
835 * Skip the comment character and white space following it.
836 */
837 linep++;
838 while (*linep == ' ' || *linep == '\t')
839 linep++;
840
841 if (*linep == '\0')
842 {
843 /*
844 * Skip over empty comment lines.
845 * XXX - should we treat that as an indication of an
846 * invalid file?
847 */
848 continue;
849 }
850
851 /*
852 * Look for the handler for this particular header line.
853 */
854 for (unsigned int i = 0U; i < HEADER_LINE_PARSE_MAPPING_LENGTH(sizeof (headerLineParseMapping) / sizeof (headerLineParseMapping
)[0])
; i++)
855 {
856 const headerLineParseMapping_t *pHeaderMapping = &headerLineParseMapping[i];
857 size_t matchStringLen = strlen(pHeaderMapping->pMatchString);
858
859 if (strncmp(linep, pHeaderMapping->pMatchString, matchStringLen) == 0 &&
860 pHeaderMapping->parseFunc != NULL((void*)0))
861 {
862 /*
863 * This matches this header value.
864 * Skip past the tag.
865 */
866 linep += matchStringLen;
867
868 /* Replace any newline chars with end of line */
869 for (char *pChar = linep; ; pChar++)
870 {
871 if (*pChar == '\n' || *pChar == '\r' || *pChar == '\0')
872 {
873 *pChar = '\0';
874 break;
875 }
876 }
877
878 /*
879 * Call the handler.
880 */
881 if (!pHeaderMapping->parseFunc(clLog, linep, err, err_info))
882 {
883 /*
884 * XXX - should this file be rejected as not
885 * one of ours? Given the line looks like
886 * a comment that begins with a valid header
887 * field tag, it may be likely to be one of
888 * ours.
889 */
890 g_free(clLog)(__builtin_object_size ((clLog), 0) != ((size_t) - 1)) ? g_free_sized
(clLog, __builtin_object_size ((clLog), 0)) : (g_free) (clLog
)
;
891 if (*err == WTAP_ERR_BAD_FILE-13)
892 {
893 wmem_free(NULL((void*)0), *err_info);
894 *err_info = NULL((void*)0);
895 }
896 return WTAP_OPEN_NOT_MINE;
897 }
898 saw_header_line = true1;
899 }
900 }
901 }
902
903 /*
904 * Did file_gets() fail?
905 */
906 if (linep == NULL((void*)0))
907 {
908 /*
909 * Yes - file_gets() didn't return a line.
910 * Did it get an error?
911 */
912 *err = file_error(wth->fh, err_info);
913 if (*err != 0)
914 {
915 /* Yes. What was it? */
916 if (*err == WTAP_ERR_SHORT_READ-12)
917 {
918 /* Incomplete header, so not ours. */
919 g_free(clLog)(__builtin_object_size ((clLog), 0) != ((size_t) - 1)) ? g_free_sized
(clLog, __builtin_object_size ((clLog), 0)) : (g_free) (clLog
)
;
920 return WTAP_OPEN_NOT_MINE;
921 }
922 else
923 {
924 /* I/O error. */
925 g_free(clLog)(__builtin_object_size ((clLog), 0) != ((size_t) - 1)) ? g_free_sized
(clLog, __builtin_object_size ((clLog), 0)) : (g_free) (clLog
)
;
926 return WTAP_OPEN_ERROR;
927 }
928 }
929
930 /*
931 * No, it just got an EOF. If we saw at least one valid
932 * header line, treat it as our file, as older versions did
933 * so; it might be the log of a session that logged nothing.
934 *
935 * Otherwise, it's empty or consists only of other comment
936 * lines, which could be any of a number of file types
937 * (e.g., configuration files), so it's not ours.
938 *
939 * XXX - should we treat it as not our file in any case, as it
940 * lacks the column header line?
941 */
942 if (!saw_header_line)
943 {
944 g_free(clLog)(__builtin_object_size ((clLog), 0) != ((size_t) - 1)) ? g_free_sized
(clLog, __builtin_object_size ((clLog), 0)) : (g_free) (clLog
)
;
945 return WTAP_OPEN_NOT_MINE;
946 }
947 }
948 else
949 {
950 /*
951 * We've read the first line after the header, so it's the column
952 * header line. Parse it. This requires that we have been provided with a
953 * valid separator.
954 */
955 if (clLog->separator == '\0' || !parseColumnHeaderFields(clLog, linep))
956 {
957 g_free(clLog)(__builtin_object_size ((clLog), 0) != ((size_t) - 1)) ? g_free_sized
(clLog, __builtin_object_size ((clLog), 0)) : (g_free) (clLog
)
;
958 return WTAP_OPEN_NOT_MINE;
959 }
960 }
961
962 wtap_set_as_socketcan(wth, cllog_file_type_subtype, WTAP_TSPREC_MSEC3, clLog, cllog_close);
963 wth->snapshot_length = 0;
964
965 wth->subtype_read = cllog_read;
966 wth->subtype_seek_read = cllog_seek_read;
967
968 return WTAP_OPEN_MINE;
969}
970
971/* Options for packet blocks. */
972static const struct supported_option_type packet_block_options_supported[] = {
973 { OPT_PKT_FLAGS2, ONE_OPTION_SUPPORTED },
974};
975
976static const struct supported_block_type cllog_blocks_supported[] = {
977 /*
978 * We support packet blocks, with only the flags option supported.
979 */
980 { WTAP_BLOCK_PACKET, MULTIPLE_BLOCKS_SUPPORTED, OPTION_TYPES_SUPPORTED(packet_block_options_supported)(sizeof (packet_block_options_supported) / sizeof (packet_block_options_supported
)[0]), packet_block_options_supported
}
981};
982
983static const struct file_type_subtype_info cllog_info = {
984 "CSS Electronics CLX000 CAN log", "cllog", "txt", NULL((void*)0),
985 false0, BLOCKS_SUPPORTED(cllog_blocks_supported)(sizeof (cllog_blocks_supported) / sizeof (cllog_blocks_supported
)[0]), cllog_blocks_supported
,
986 NULL((void*)0), NULL((void*)0), NULL((void*)0)
987};
988
989void
990register_canlogger(void)
991{
992 cllog_file_type_subtype = wtap_register_file_type_subtype(&cllog_info);
993}