33 #if defined(HAVE_DIRENT_H) && defined(HAVE_FNMATCH_H)
34 #define INIT_RING_BUFFER
58 #define DEFAULT_LOG_FILENAME "pcaplog"
59 #define MODULE_NAME "PcapLog"
60 #define MIN_LIMIT 4 * 1024 * 1024
61 #define DEFAULT_LIMIT 100 * 1024 * 1024
62 #define DEFAULT_FILE_LIMIT 0
64 #define LOGMODE_NORMAL 0
65 #define LOGMODE_MULTI 1
73 #define RING_BUFFER_MODE_DISABLED 0
74 #define RING_BUFFER_MODE_ENABLED 1
76 #define TS_FORMAT_SEC 0
77 #define TS_FORMAT_USEC 1
79 #define USE_STREAM_DEPTH_DISABLED 0
80 #define USE_STREAM_DEPTH_ENABLED 1
82 #define HONOR_PASS_RULES_DISABLED 0
83 #define HONOR_PASS_RULES_ENABLED 1
85 #define PCAP_SNAPLEN 262144
86 #define PCAP_BUFFER_TIMEOUT 1000000 // microseconds
87 #define PCAP_PKTHDR_SIZE 16
113 #define MAX_FILENAMELEN 513
125 LZ4F_compressionContext_t lz4f_context;
126 LZ4F_preferences_t lz4f_prefs;
145 struct pcap_pkthdr *
h;
170 uint32_t thread_number;
172 int timestamp_format;
179 int filename_part_cnt;
180 struct timeval last_pcap_dump;
193 static const char timestamp_pattern[] =
".*?(\\d+)(\\.(\\d+))?";
194 static pcre2_code *pcre_timestamp_code = NULL;
195 static pcre2_match_data *pcre_timestamp_match = NULL;
205 static void PcapLogFileDeInitCtx(
OutputCtx *);
213 PcapLogInitCtx, PcapLog, PcapLogCondition, PcapLogDataInit,
214 PcapLogDataDeinit, NULL);
220 #define PCAPLOG_PROFILE_START \
221 uint64_t pcaplog_profile_ticks = UtilCpuGetTicks()
223 #define PCAPLOG_PROFILE_END(prof) \
224 (prof).total += (UtilCpuGetTicks() - pcaplog_profile_ticks); \
273 SCLogError(
"SCFmemopen failed: %s", strerror(errno));
292 uint64_t bytes_written = LZ4F_compressEnd(comp->lz4f_context,
294 if (LZ4F_isError(bytes_written)) {
295 SCLogError(
"LZ4F_compressEnd: %s", LZ4F_getErrorName(bytes_written));
298 if (fwrite(comp->
buffer, 1, bytes_written, comp->
file) < bytes_written) {
299 SCLogError(
"fwrite failed: %s", strerror(errno));
341 if (PcapLogCloseFile(t,pl) < 0) {
357 PcapFileNameFree(pf);
361 if (PcapLogOpenFileCtx(pl) < 0) {
362 SCLogError(
"opening new pcap log file failed");
382 SCLogDebug(
"Setting pcap-log link type to %u", datalink);
393 if (!pl->pcap_open_err) {
395 pl->pcap_open_err =
true;
399 pl->pcap_open_err =
false;
407 if (comp->
file == NULL) {
408 if (errno != pl->fopen_err) {
409 SCLogError(
"Error opening file for compressed output: %s", strerror(errno));
410 pl->fopen_err = errno;
419 if (!pl->pcap_open_err) {
421 pl->pcap_open_err =
true;
427 pl->pcap_open_err =
false;
430 uint64_t bytes_written = LZ4F_compressBegin(comp->lz4f_context,
432 if (LZ4F_isError(bytes_written)) {
433 SCLogError(
"LZ4F_compressBegin: %s", LZ4F_getErrorName(bytes_written));
436 if (fwrite(comp->
buffer, 1, bytes_written, comp->
file) < bytes_written) {
437 SCLogError(
"fwrite failed: %s", strerror(errno));
474 static inline int PcapWrite(
477 struct timeval current_dump;
478 gettimeofday(¤t_dump, NULL);
488 SCLogError(
"ftell failed with: %s", strerror(errno));
491 uint64_t out_size = LZ4F_compressUpdate(comp->lz4f_context, comp->
buffer, comp->
buffer_size,
492 comp->
pcap_buf, (uint64_t)in_size, NULL);
493 if (LZ4F_isError(
len)) {
494 SCLogError(
"LZ4F_compressUpdate: %s", LZ4F_getErrorName(
len));
498 SCLogError(
"fseek failed: %s", strerror(errno));
501 if (fwrite(comp->
buffer, 1, out_size, comp->
file) < out_size) {
502 SCLogError(
"fwrite failed: %s", strerror(errno));
516 pl->last_pcap_dump = current_dump;
526 static int PcapLogSegmentCallback(
527 const Packet *p,
TcpSegment *seg,
void *data,
const uint8_t *buf, uint32_t buflen)
536 MemBufferReset(pctx->
buf);
545 static void PcapLogDumpSegments(
596 ret = PcapLogOpenFileCtx(
pl);
607 if (PcapLogRotateFile(t,
pl) < 0) {
623 if (PcapLogRotateFile(t,
pl) < 0) {
646 if (PacketIsTCP(p)) {
648 PcapLogDumpSegments(td,
comp, p);
686 SCLogDebug(
"pl->size_current %"PRIu64
", pl->size_limit %"PRIu64,
708 if (
unlikely(copy->prefix == NULL)) {
714 copy->suffix =
pl->suffix;
720 copy->use_ringbuffer =
pl->use_ringbuffer;
721 copy->timestamp_format =
pl->timestamp_format;
736 copy_comp->lz4f_prefs =
comp->lz4f_prefs;
741 if (copy_comp->
buffer == NULL) {
742 SCLogError(
"SCMalloc failed: %s", strerror(errno));
749 SCLogError(
"SCMalloc failed: %s", strerror(errno));
758 SCLogError(
"SCFmemopen failed: %s", strerror(errno));
768 LZ4F_errorCode_t errcode =
769 LZ4F_createCompressionContext(©_comp->lz4f_context, 1);
770 if (LZ4F_isError(errcode)) {
771 SCLogError(
"LZ4F_createCompressionContext failed: %s", LZ4F_getErrorName(errcode));
782 copy_comp->
file = NULL;
790 strlcpy(copy->dir,
pl->dir,
sizeof(copy->dir));
792 for (
int i = 0; i <
pl->filename_part_cnt && i <
MAX_TOKS; i++)
793 copy->filename_parts[i] =
pl->filename_parts[i];
794 copy->filename_part_cnt =
pl->filename_part_cnt;
803 #ifdef INIT_RING_BUFFER
804 static int PcapLogGetTimeOfFile(
const char *filename, uint64_t *secs,
810 int n = pcre2_match(pcre_timestamp_code, (PCRE2_SPTR8)filename, strlen(filename), 0, 0,
811 pcre_timestamp_match, NULL);
812 if (n != 2 && n != 4) {
819 copylen =
sizeof(
buf);
820 if (pcre2_substring_copy_bynumber(pcre_timestamp_match, 1, (PCRE2_UCHAR8 *)
buf, ©len) <
830 copylen =
sizeof(
buf);
831 if (pcre2_substring_copy_bynumber(pcre_timestamp_match, 3, (PCRE2_UCHAR8 *)
buf, ©len) <
845 char pattern[PATH_MAX];
847 SCLogInfo(
"Initializing PCAP ring buffer for %s/%s.",
848 pl->dir,
pl->prefix);
851 if (pattern[strlen(pattern) - 1] !=
'/') {
852 strlcat(pattern,
"/", PATH_MAX);
855 for (
int i = 0; i <
pl->filename_part_cnt; i++) {
856 char *part =
pl->filename_parts[i];
857 if (part == NULL || strlen(part) == 0) {
860 if (part[0] !=
'%' || strlen(part) < 2) {
861 strlcat(pattern, part, PATH_MAX);
866 SCLogError(
"Thread ID not allowed in ring buffer mode.");
870 snprintf(tmp, PATH_MAX,
"%"PRIu32,
pl->thread_number);
871 strlcat(pattern, tmp, PATH_MAX);
875 strlcat(pattern,
"*", PATH_MAX);
878 SCLogError(
"Unsupported format character: %%%s", part);
884 strlcat(pattern,
".*", PATH_MAX);
888 char *basename = strrchr(pattern,
'/');
892 DIR *dir = opendir(pattern);
894 SCLogWarning(
"Failed to open directory %s: %s", pattern, strerror(errno));
899 struct dirent *entry = readdir(dir);
903 if (fnmatch(basename, entry->d_name, 0) != 0) {
910 if (!PcapLogGetTimeOfFile(entry->d_name, &secs, &usecs)) {
921 if (snprintf(path, PATH_MAX,
"%s/%s", pattern, entry->d_name) == PATH_MAX)
976 PcapFileNameFree(pf);
994 if (initdata == NULL) {
995 SCLogDebug(
"Error getting context for LogPcap. \"initdata\" argument NULL");
1006 td->
pcap_log = PcapLogDataCopy(pl);
1013 FatalError(
"Pcap logging with multiple link type is not supported.");
1024 FatalError(
"Can't have multiple link types in pcap conditional mode.");
1027 SCLogWarning(
"Using multiple link types can result in invalid pcap output");
1063 #ifdef INIT_RING_BUFFER
1068 SCLogInfo(
"Unable to initialize ring buffer on this platform.");
1079 PcapLogOpenFileCtx(pl);
1089 dst->profile_open.total +=
src->profile_open.total;
1090 dst->profile_open.cnt +=
src->profile_open.cnt;
1092 dst->profile_close.total +=
src->profile_close.total;
1093 dst->profile_close.cnt +=
src->profile_close.cnt;
1095 dst->profile_write.total +=
src->profile_write.total;
1096 dst->profile_write.cnt +=
src->profile_write.cnt;
1098 dst->profile_rotate.total +=
src->profile_rotate.total;
1099 dst->profile_rotate.cnt +=
src->profile_rotate.cnt;
1101 dst->profile_handles.total +=
src->profile_handles.total;
1102 dst->profile_handles.cnt +=
src->profile_handles.cnt;
1104 dst->profile_lock.total +=
src->profile_lock.total;
1105 dst->profile_lock.cnt +=
src->profile_lock.cnt;
1107 dst->profile_unlock.total +=
src->profile_unlock.total;
1108 dst->profile_unlock.cnt +=
src->profile_unlock.cnt;
1110 dst->profile_data_size +=
src->profile_data_size;
1117 while ((pf =
TAILQ_FIRST(&pl->pcap_file_list)) != NULL) {
1119 PcapFileNameFree(pf);
1121 if (pl == g_pcap_data) {
1122 for (
int i = 0; i <
MAX_TOKS; i++) {
1123 if (pl->filename_parts[i] != NULL) {
1124 SCFree(pl->filename_parts[i]);
1138 SCFree(pl->compression.buffer);
1139 fclose(pl->compression.pcap_buf_wrapper);
1140 SCFree(pl->compression.pcap_buf);
1141 LZ4F_errorCode_t errcode =
1142 LZ4F_freeCompressionContext(pl->compression.lz4f_context);
1143 if (LZ4F_isError(errcode)) {
1165 if (PcapLogCloseFile(t,pl) < 0) {
1172 StatsMerge(g_pcap_data, pl);
1173 g_pcap_data->reported++;
1174 if (g_pcap_data->threads == g_pcap_data->reported)
1175 PcapLogProfilingDump(g_pcap_data);
1178 if (pl->reported == 0) {
1179 PcapLogProfilingDump(pl);
1184 if (pl != g_pcap_data) {
1185 PcapLogDataFree(pl);
1196 static int ParseFilename(
PcapLogData *pl,
const char *filename)
1203 size_t filename_len = 0;
1206 filename_len = strlen(filename);
1212 for (
int i = 0; i < (int)strlen(filename); i++) {
1214 SCLogError(
"invalid filename option. Max 2 %%-sign options");
1218 str[s++] = filename[i];
1220 if (filename[i] ==
'%') {
1231 if (i+1 < (
int)strlen(filename)) {
1233 SCLogError(
"invalid filename option. Max 2 %%-sign options");
1237 if (filename[i+1] !=
'n' && filename[i+1] !=
't' && filename[i+1] !=
'i') {
1239 "invalid filename option. Valid %%-sign options: %%n, %%i and %%t");
1243 str[1] = filename[i+1];
1255 SCLogError(
"Invalid filename for multimode. Need at least one %%-sign option");
1261 SCLogError(
"invalid filename option. Max 3 %%-sign options");
1273 for (
int i = 0; i < tok; i++) {
1274 if (toks[i] == NULL)
1278 pl->filename_parts[i] = toks[i];
1280 pl->filename_part_cnt = tok;
1284 for (
int x = 0; x <
MAX_TOKS; x++) {
1285 if (toks[x] != NULL)
1303 FatalError(
"Failed to allocate Memory for PcapLogData");
1307 if (pl->
h == NULL) {
1308 FatalError(
"Failed to allocate Memory for pcap header struct");
1325 pcre_timestamp_code =
1326 pcre2_compile((PCRE2_SPTR8)timestamp_pattern, PCRE2_ZERO_TERMINATED, 0, &en, &eo, NULL);
1327 if (pcre_timestamp_code == NULL) {
1328 PCRE2_UCHAR errbuffer[256];
1329 pcre2_get_error_message(en, errbuffer,
sizeof(errbuffer));
1331 "Failed to compile \"%s\" at offset %d: %s", timestamp_pattern, (
int)eo, errbuffer);
1333 pcre_timestamp_match = pcre2_match_data_create_from_pattern(pcre_timestamp_code, NULL);
1337 const char *filename = NULL;
1343 if (filename == NULL)
1346 if ((pl->prefix =
SCStrdup(filename)) == NULL) {
1354 const char *s_limit = NULL;
1356 if (s_limit != NULL) {
1358 SCLogError(
"Failed to initialize pcap output, invalid limit: %s", s_limit);
1362 SCLogInfo(
"pcap-log \"limit\" value of %"PRIu64
" assumed to be pre-1.2 "
1364 uint64_t size = pl->
size_limit * 1024 * 1024;
1367 FatalError(
"Fail to initialize pcap-log output, limit less than "
1368 "allowed minimum of %d bytes.",
1375 const char *s_mode = NULL;
1377 if (s_mode != NULL) {
1378 if (strcasecmp(s_mode,
"multi") == 0) {
1380 }
else if (strcasecmp(s_mode,
"normal") != 0) {
1381 FatalError(
"log-pcap: invalid mode \"%s\". Valid options: \"normal\""
1382 "or \"multi\" mode ",
1387 const char *s_dir = NULL;
1389 if (s_dir == NULL) {
1390 const char *log_dir = NULL;
1393 strlcpy(pl->dir, log_dir,
sizeof(pl->dir));
1398 s_dir,
sizeof(pl->dir));
1400 const char *log_dir = NULL;
1403 snprintf(pl->dir,
sizeof(pl->dir),
"%s/%s",
1407 struct stat stat_buf;
1408 if (stat(pl->dir, &stat_buf) != 0) {
1410 "supplied doesn't exist. Shutting down the engine",
1420 if (compression_str == NULL || strcmp(compression_str,
"none") == 0) {
1428 }
else if (strcmp(compression_str,
"lz4") == 0) {
1438 SCLogError(
"SCMalloc failed: %s", strerror(errno));
1444 SCLogError(
"SCFmemopen failed: %s", strerror(errno));
1450 memset(&comp->lz4f_prefs,
'\0',
sizeof(comp->lz4f_prefs));
1451 comp->lz4f_prefs.frameInfo.blockSizeID = LZ4F_max4MB;
1452 comp->lz4f_prefs.frameInfo.blockMode = LZ4F_blockLinked;
1454 comp->lz4f_prefs.frameInfo.contentChecksumFlag = 1;
1457 comp->lz4f_prefs.frameInfo.contentChecksumFlag = 0;
1463 }
else if (lvl < 0) {
1469 comp->lz4f_prefs.compressionLevel = lvl;
1473 LZ4F_errorCode_t errcode =
1474 LZ4F_createCompressionContext(&pl->compression.lz4f_context, 1);
1476 if (LZ4F_isError(errcode)) {
1477 SCLogError(
"LZ4F_createCompressionContext failed: %s", LZ4F_getErrorName(errcode));
1489 "lz4 output buffer.");
1496 pl->suffix =
".lz4";
1499 "in pcap-log, but suricata was not compiled with lz4 "
1501 PcapLogDataFree(pl);
1507 "compression format: %s",
1509 PcapLogDataFree(pl);
1513 SCLogInfo(
"Selected pcap-log compression method: %s",
1514 compression_str ? compression_str :
"none");
1517 if (s_conditional != NULL) {
1518 if (strcasecmp(s_conditional,
"alerts") == 0) {
1521 }
else if (strcasecmp(s_conditional,
"tag") == 0) {
1524 }
else if (strcasecmp(s_conditional,
"all") != 0) {
1525 FatalError(
"log-pcap: invalid conditional \"%s\". Valid options: \"all\", "
1526 "\"alerts\", or \"tag\" mode ",
1532 "Selected pcap-log conditional logging: %s", s_conditional ? s_conditional :
"all");
1535 if (ParseFilename(pl, filename) != 0)
1542 const char *max_number_of_files_s = NULL;
1544 if (max_number_of_files_s != NULL) {
1546 max_number_of_files_s) == -1) {
1548 "pcap-log output, invalid number of files limit: %s",
1549 max_number_of_files_s);
1551 }
else if (max_file_limit < 1) {
1552 FatalError(
"Failed to initialize pcap-log output, limit less than "
1553 "allowed minimum.");
1561 const char *ts_format = NULL;
1565 if (ts_format != NULL) {
1566 if (strcasecmp(ts_format,
"usec") == 0) {
1568 }
else if (strcasecmp(ts_format,
"sec") != 0) {
1569 SCLogError(
"log-pcap ts_format specified %s is invalid must be"
1570 " \"sec\" or \"usec\"",
1576 const char *use_stream_depth = NULL;
1580 if (use_stream_depth != NULL) {
1586 FatalError(
"log-pcap use_stream_depth specified is invalid must be");
1590 const char *honor_pass_rules = NULL;
1594 if (honor_pass_rules != NULL) {
1600 FatalError(
"log-pcap honor-pass-rules specified is invalid");
1607 if (
unlikely(output_ctx == NULL)) {
1608 FatalError(
"Failed to allocate memory for OutputCtx.");
1610 output_ctx->
data = pl;
1611 output_ctx->
DeInit = PcapLogFileDeInitCtx;
1614 result.
ctx = output_ctx;
1619 static void PcapLogFileDeInitCtx(
OutputCtx *output_ctx)
1621 if (output_ctx == NULL)
1630 PcapLogDataFree(pl);
1633 pcre2_code_free(pcre_timestamp_code);
1634 pcre2_match_data_free(pcre_timestamp_match);
1647 char *filename = NULL;
1674 ret = snprintf(filename, PATH_MAX,
"%s/%s.%" PRIu32
"%s", pl->dir, pl->prefix,
1677 ret = snprintf(filename, PATH_MAX,
"%s/%s.%" PRIu32
".%" PRIu32
"%s", pl->dir,
1680 if (ret < 0 || (
size_t)ret >= PATH_MAX) {
1685 if (pl->filename_part_cnt > 0) {
1688 strlcpy(filename, pl->dir, PATH_MAX);
1689 strlcat(filename,
"/", PATH_MAX);
1691 for (
int i = 0; i < pl->filename_part_cnt; i++) {
1692 if (pl->filename_parts[i] == NULL ||strlen(pl->filename_parts[i]) == 0)
1696 if (pl->filename_parts[i][0] ==
'%') {
1698 if (strlen(pl->filename_parts[i]) < 2)
1701 switch(pl->filename_parts[i][1]) {
1703 snprintf(
str,
sizeof(
str),
"%u", pl->thread_number);
1708 snprintf(
str,
sizeof(
str),
"%"PRIu64, (uint64_t)thread_id);
1716 snprintf(
str,
sizeof(
str),
"%" PRIu32
".%" PRIu32,
1724 strlcat(filename, pl->filename_parts[i], PATH_MAX);
1727 strlcat(filename, pl->suffix, PATH_MAX);
1732 ret = snprintf(filename, PATH_MAX,
"%s/%s.%u.%" PRIu32
"%s", pl->dir, pl->prefix,
1735 ret = snprintf(filename, PATH_MAX,
"%s/%s.%u.%" PRIu32
".%" PRIu32
"%s", pl->dir,
1739 if (ret < 0 || (
size_t)ret >= PATH_MAX) {
1744 SCLogDebug(
"multi-mode: filename %s", filename);
1748 SCLogError(
"Error allocating memory. For filename");
1761 PcapFileNameFree(pf);
1774 static int profiling_pcaplog_enabled = 0;
1775 static int profiling_pcaplog_output_to_file = 0;
1776 static char *profiling_pcaplog_file_name = NULL;
1777 static const char *profiling_pcaplog_file_mode =
"a";
1779 static void FormatNumber(uint64_t num,
char *
str,
size_t size)
1782 snprintf(
str, size,
"%"PRIu64, num);
1783 else if (num < 1000000UL)
1784 snprintf(
str, size,
"%3.1fk", (
float)num/1000UL);
1785 else if (num < 1000000000UL)
1786 snprintf(
str, size,
"%3.1fm", (
float)num/1000000UL);
1788 snprintf(
str, size,
"%3.1fb", (
float)num/1000000000UL);
1793 char ticks_str[32] =
"n/a";
1794 char cnt_str[32] =
"n/a";
1795 char avg_str[32] =
"n/a";
1797 FormatNumber((uint64_t)p->
cnt, cnt_str,
sizeof(cnt_str));
1798 FormatNumber((uint64_t)p->
total, ticks_str,
sizeof(ticks_str));
1800 FormatNumber((uint64_t)(p->
total/p->
cnt), avg_str,
sizeof(avg_str));
1802 fprintf(fp,
"%-28s %-10s %-10s %-10s\n", name, cnt_str, avg_str, ticks_str);
1805 static void ProfileReport(FILE *fp,
PcapLogData *pl)
1810 ProfileReportPair(fp,
"rotate (incl open/close)", &pl->
profile_rotate);
1816 static void FormatBytes(uint64_t num,
char *
str,
size_t size)
1819 snprintf(
str, size,
"%"PRIu64, num);
1820 else if (num < 1048576UL)
1821 snprintf(
str, size,
"%3.1fKiB", (
float)num/1000UL);
1822 else if (num < 1073741824UL)
1823 snprintf(
str, size,
"%3.1fMiB", (
float)num/1000000UL);
1825 snprintf(
str, size,
"%3.1fGiB", (
float)num/1000000000UL);
1832 if (profiling_pcaplog_enabled == 0)
1835 if (profiling_pcaplog_output_to_file == 1) {
1836 fp = fopen(profiling_pcaplog_file_name, profiling_pcaplog_file_mode);
1838 SCLogError(
"failed to open %s: %s", profiling_pcaplog_file_name, strerror(errno));
1846 fprintf(fp,
"\n\nOperation Cnt Avg ticks Total ticks\n");
1847 fprintf(fp,
"---------------------------- ---------- ---------- -----------\n");
1849 ProfileReport(fp, pl);
1856 fprintf(fp,
"\nOverall: %"PRIu64
" bytes written, average %d bytes per write.\n",
1859 fprintf(fp,
" PCAP data structure overhead: %"PRIuMAX
" per write.\n",
1860 (uintmax_t)
sizeof(
struct pcap_pkthdr));
1865 fprintf(fp,
" Size written: %s\n", bytes_str);
1868 uint64_t ticks_per_mib = 0, ticks_per_gib = 0;
1871 ticks_per_mib = total/mib;
1872 char ticks_per_mib_str[32] =
"n/a";
1873 if (ticks_per_mib > 0)
1874 FormatNumber(ticks_per_mib, ticks_per_mib_str,
sizeof(ticks_per_mib_str));
1875 fprintf(fp,
" Ticks per MiB: %s\n", ticks_per_mib_str);
1879 ticks_per_gib = total/gib;
1880 char ticks_per_gib_str[32] =
"n/a";
1881 if (ticks_per_gib > 0)
1882 FormatNumber(ticks_per_gib, ticks_per_gib_str,
sizeof(ticks_per_gib_str));
1883 fprintf(fp,
" Ticks per GiB: %s\n", ticks_per_gib_str);
1893 profiling_pcaplog_enabled = 1;
1894 SCLogInfo(
"pcap-log profiling enabled");
1897 if (filename != NULL) {
1898 const char *log_dir;
1901 profiling_pcaplog_file_name =
SCMalloc(PATH_MAX);
1902 if (
unlikely(profiling_pcaplog_file_name == NULL)) {
1906 snprintf(profiling_pcaplog_file_name, PATH_MAX,
"%s/%s", log_dir, filename);
1910 profiling_pcaplog_file_mode =
"a";
1912 profiling_pcaplog_file_mode =
"w";
1915 profiling_pcaplog_output_to_file = 1;
1916 SCLogInfo(
"pcap-log profiling output goes to %s (mode %s)",
1917 profiling_pcaplog_file_name, profiling_pcaplog_file_mode);