33 #if defined(HAVE_DIRENT_H) && defined(HAVE_FNMATCH_H)
34 #define INIT_RING_BUFFER
59 #define DEFAULT_LOG_FILENAME "pcaplog"
60 #define MODULE_NAME "PcapLog"
61 #define MIN_LIMIT 4 * 1024 * 1024
62 #define DEFAULT_LIMIT 100 * 1024 * 1024
63 #define DEFAULT_FILE_LIMIT 0
65 #define LOGMODE_NORMAL 0
66 #define LOGMODE_MULTI 1
74 #define RING_BUFFER_MODE_DISABLED 0
75 #define RING_BUFFER_MODE_ENABLED 1
77 #define TS_FORMAT_SEC 0
78 #define TS_FORMAT_USEC 1
80 #define USE_STREAM_DEPTH_DISABLED 0
81 #define USE_STREAM_DEPTH_ENABLED 1
83 #define HONOR_PASS_RULES_DISABLED 0
84 #define HONOR_PASS_RULES_ENABLED 1
86 #define PCAP_SNAPLEN 262144
87 #define PCAP_BUFFER_TIMEOUT 1000000 // microseconds
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);
221 #define PCAPLOG_PROFILE_START \
222 uint64_t pcaplog_profile_ticks = UtilCpuGetTicks()
224 #define PCAPLOG_PROFILE_END(prof) \
225 (prof).total += (UtilCpuGetTicks() - pcaplog_profile_ticks); \
276 SCLogError(
"SCFmemopen failed: %s", strerror(errno));
295 uint64_t bytes_written = LZ4F_compressEnd(comp->lz4f_context,
297 if (LZ4F_isError(bytes_written)) {
298 SCLogError(
"LZ4F_compressEnd: %s", LZ4F_getErrorName(bytes_written));
301 if (fwrite(comp->
buffer, 1, bytes_written, comp->
file) < bytes_written) {
302 SCLogError(
"fwrite failed: %s", strerror(errno));
346 if (PcapLogCloseFile(t,pl) < 0) {
362 PcapFileNameFree(pf);
366 if (PcapLogOpenFileCtx(pl) < 0) {
367 SCLogError(
"opening new pcap log file failed");
387 SCLogDebug(
"Setting pcap-log link type to %u", datalink);
398 if (!pl->pcap_open_err) {
400 pl->pcap_open_err =
true;
404 pl->pcap_open_err =
false;
412 if (comp->
file == NULL) {
413 if (errno != pl->fopen_err) {
414 SCLogError(
"Error opening file for compressed output: %s", strerror(errno));
415 pl->fopen_err = errno;
424 if (!pl->pcap_open_err) {
426 pl->pcap_open_err =
true;
432 pl->pcap_open_err =
false;
435 uint64_t bytes_written = LZ4F_compressBegin(comp->lz4f_context,
437 if (LZ4F_isError(bytes_written)) {
438 SCLogError(
"LZ4F_compressBegin: %s", LZ4F_getErrorName(bytes_written));
441 if (fwrite(comp->
buffer, 1, bytes_written, comp->
file) < bytes_written) {
442 SCLogError(
"fwrite failed: %s", strerror(errno));
479 static inline int PcapWrite(
482 struct timeval current_dump;
483 gettimeofday(¤t_dump, NULL);
493 SCLogError(
"ftell failed with: %s", strerror(errno));
496 uint64_t out_size = LZ4F_compressUpdate(comp->lz4f_context, comp->
buffer, comp->
buffer_size,
497 comp->
pcap_buf, (uint64_t)in_size, NULL);
498 if (LZ4F_isError(
len)) {
499 SCLogError(
"LZ4F_compressUpdate: %s", LZ4F_getErrorName(
len));
502 if (fseek(pl->compression.pcap_buf_wrapper, 0, SEEK_SET) != 0) {
503 SCLogError(
"fseek failed: %s", strerror(errno));
506 if (fwrite(comp->
buffer, 1, out_size, comp->
file) < out_size) {
507 SCLogError(
"fwrite failed: %s", strerror(errno));
521 pl->last_pcap_dump = current_dump;
531 static int PcapLogSegmentCallback(
532 const Packet *p,
TcpSegment *seg,
void *data,
const uint8_t *buf, uint32_t buflen)
541 MemBufferReset(pctx->
buf);
550 static void PcapLogDumpSegments(
603 ret = PcapLogOpenFileCtx(
pl);
614 if (PcapLogRotateFile(t,
pl) < 0) {
631 if (PcapLogRotateFile(t,
pl) < 0) {
657 PcapLogDumpSegments(td, comp, p);
659 PcapLogDumpSegments(td, NULL, p);
705 SCLogDebug(
"pl->size_current %"PRIu64
", pl->size_limit %"PRIu64,
727 if (
unlikely(copy->prefix == NULL)) {
733 copy->suffix =
pl->suffix;
739 copy->use_ringbuffer =
pl->use_ringbuffer;
740 copy->timestamp_format =
pl->timestamp_format;
755 copy_comp->lz4f_prefs = comp->lz4f_prefs;
760 if (copy_comp->
buffer == NULL) {
761 SCLogError(
"SCMalloc failed: %s", strerror(errno));
768 SCLogError(
"SCMalloc failed: %s", strerror(errno));
777 SCLogError(
"SCFmemopen failed: %s", strerror(errno));
787 LZ4F_errorCode_t errcode =
788 LZ4F_createCompressionContext(©_comp->lz4f_context, 1);
789 if (LZ4F_isError(errcode)) {
790 SCLogError(
"LZ4F_createCompressionContext failed: %s", LZ4F_getErrorName(errcode));
801 copy_comp->
file = NULL;
809 strlcpy(copy->dir,
pl->dir,
sizeof(copy->dir));
812 for (i = 0; i <
pl->filename_part_cnt && i <
MAX_TOKS; i++)
813 copy->filename_parts[i] =
pl->filename_parts[i];
814 copy->filename_part_cnt =
pl->filename_part_cnt;
823 #ifdef INIT_RING_BUFFER
824 static int PcapLogGetTimeOfFile(
const char *filename, uint64_t *secs,
830 int n = pcre2_match(pcre_timestamp_code, (PCRE2_SPTR8)filename, strlen(filename), 0, 0,
831 pcre_timestamp_match, NULL);
832 if (n != 2 && n != 4) {
839 copylen =
sizeof(
buf);
840 if (pcre2_substring_copy_bynumber(pcre_timestamp_match, 1, (PCRE2_UCHAR8 *)
buf, ©len) <
850 copylen =
sizeof(
buf);
851 if (pcre2_substring_copy_bynumber(pcre_timestamp_match, 3, (PCRE2_UCHAR8 *)
buf, ©len) <
865 char pattern[PATH_MAX];
867 SCLogInfo(
"Initializing PCAP ring buffer for %s/%s.",
868 pl->dir,
pl->prefix);
871 if (pattern[strlen(pattern) - 1] !=
'/') {
872 strlcat(pattern,
"/", PATH_MAX);
875 for (
int i = 0; i <
pl->filename_part_cnt; i++) {
876 char *part =
pl->filename_parts[i];
877 if (part == NULL || strlen(part) == 0) {
880 if (part[0] !=
'%' || strlen(part) < 2) {
881 strlcat(pattern, part, PATH_MAX);
886 SCLogError(
"Thread ID not allowed in ring buffer mode.");
890 snprintf(tmp, PATH_MAX,
"%"PRIu32,
pl->thread_number);
891 strlcat(pattern, tmp, PATH_MAX);
895 strlcat(pattern,
"*", PATH_MAX);
898 SCLogError(
"Unsupported format character: %%%s", part);
904 strlcat(pattern,
".*", PATH_MAX);
908 char *basename = strrchr(pattern,
'/');
912 DIR *dir = opendir(pattern);
914 SCLogWarning(
"Failed to open directory %s: %s", pattern, strerror(errno));
919 struct dirent *entry = readdir(dir);
923 if (fnmatch(basename, entry->d_name, 0) != 0) {
930 if (!PcapLogGetTimeOfFile(entry->d_name, &secs, &usecs)) {
941 if (snprintf(path, PATH_MAX,
"%s/%s", pattern, entry->d_name) == PATH_MAX)
996 PcapFileNameFree(pf);
1012 static TmEcode PcapLogDataInit(
ThreadVars *t,
const void *initdata,
void **data)
1014 if (initdata == NULL) {
1015 SCLogDebug(
"Error getting context for LogPcap. \"initdata\" argument NULL");
1026 td->
pcap_log = PcapLogDataCopy(pl);
1033 FatalError(
"Pcap logging with multiple link type is not supported.");
1044 FatalError(
"Can't have multiple link types in pcap conditional mode.");
1047 SCLogWarning(
"Using multiple link types can result in invalid pcap output");
1083 #ifdef INIT_RING_BUFFER
1088 SCLogInfo(
"Unable to initialize ring buffer on this platform.");
1099 PcapLogOpenFileCtx(pl);
1109 dst->profile_open.total +=
src->profile_open.total;
1110 dst->profile_open.cnt +=
src->profile_open.cnt;
1112 dst->profile_close.total +=
src->profile_close.total;
1113 dst->profile_close.cnt +=
src->profile_close.cnt;
1115 dst->profile_write.total +=
src->profile_write.total;
1116 dst->profile_write.cnt +=
src->profile_write.cnt;
1118 dst->profile_rotate.total +=
src->profile_rotate.total;
1119 dst->profile_rotate.cnt +=
src->profile_rotate.cnt;
1121 dst->profile_handles.total +=
src->profile_handles.total;
1122 dst->profile_handles.cnt +=
src->profile_handles.cnt;
1124 dst->profile_lock.total +=
src->profile_lock.total;
1125 dst->profile_lock.cnt +=
src->profile_lock.cnt;
1127 dst->profile_unlock.total +=
src->profile_unlock.total;
1128 dst->profile_unlock.cnt +=
src->profile_unlock.cnt;
1130 dst->profile_data_size +=
src->profile_data_size;
1137 while ((pf =
TAILQ_FIRST(&pl->pcap_file_list)) != NULL) {
1139 PcapFileNameFree(pf);
1141 if (pl == g_pcap_data) {
1142 for (
int i = 0; i <
MAX_TOKS; i++) {
1143 if (pl->filename_parts[i] != NULL) {
1144 SCFree(pl->filename_parts[i]);
1158 SCFree(pl->compression.buffer);
1159 fclose(pl->compression.pcap_buf_wrapper);
1160 SCFree(pl->compression.pcap_buf);
1161 LZ4F_errorCode_t errcode =
1162 LZ4F_freeCompressionContext(pl->compression.lz4f_context);
1163 if (LZ4F_isError(errcode)) {
1185 if (PcapLogCloseFile(t,pl) < 0) {
1192 StatsMerge(g_pcap_data, pl);
1193 g_pcap_data->reported++;
1194 if (g_pcap_data->threads == g_pcap_data->reported)
1195 PcapLogProfilingDump(g_pcap_data);
1198 if (pl->reported == 0) {
1199 PcapLogProfilingDump(pl);
1204 if (pl != g_pcap_data) {
1205 PcapLogDataFree(pl);
1216 static int ParseFilename(
PcapLogData *pl,
const char *filename)
1224 size_t filename_len = 0;
1227 filename_len = strlen(filename);
1233 for (i = 0; i < (int)strlen(filename); i++) {
1235 SCLogError(
"invalid filename option. Max 2 %%-sign options");
1239 str[s++] = filename[i];
1241 if (filename[i] ==
'%') {
1252 if (i+1 < (
int)strlen(filename)) {
1254 SCLogError(
"invalid filename option. Max 2 %%-sign options");
1258 if (filename[i+1] !=
'n' && filename[i+1] !=
't' && filename[i+1] !=
'i') {
1260 "invalid filename option. Valid %%-sign options: %%n, %%i and %%t");
1264 str[1] = filename[i+1];
1276 SCLogError(
"Invalid filename for multimode. Need at least one %%-sign option");
1282 SCLogError(
"invalid filename option. Max 3 %%-sign options");
1294 for (i = 0; i < tok; i++) {
1295 if (toks[i] == NULL)
1299 pl->filename_parts[i] = toks[i];
1301 pl->filename_part_cnt = tok;
1306 if (toks[x] != NULL)
1324 FatalError(
"Failed to allocate Memory for PcapLogData");
1328 if (pl->
h == NULL) {
1329 FatalError(
"Failed to allocate Memory for pcap header struct");
1346 pcre_timestamp_code =
1347 pcre2_compile((PCRE2_SPTR8)timestamp_pattern, PCRE2_ZERO_TERMINATED, 0, &en, &eo, NULL);
1348 if (pcre_timestamp_code == NULL) {
1349 PCRE2_UCHAR errbuffer[256];
1350 pcre2_get_error_message(en, errbuffer,
sizeof(errbuffer));
1352 "Failed to compile \"%s\" at offset %d: %s", timestamp_pattern, (
int)eo, errbuffer);
1354 pcre_timestamp_match = pcre2_match_data_create_from_pattern(pcre_timestamp_code, NULL);
1358 const char *filename = NULL;
1364 if (filename == NULL)
1367 if ((pl->prefix =
SCStrdup(filename)) == NULL) {
1375 const char *s_limit = NULL;
1377 if (s_limit != NULL) {
1379 SCLogError(
"Failed to initialize pcap output, invalid limit: %s", s_limit);
1383 SCLogInfo(
"pcap-log \"limit\" value of %"PRIu64
" assumed to be pre-1.2 "
1385 uint64_t size = pl->
size_limit * 1024 * 1024;
1388 FatalError(
"Fail to initialize pcap-log output, limit less than "
1389 "allowed minimum of %d bytes.",
1396 const char *s_mode = NULL;
1398 if (s_mode != NULL) {
1399 if (strcasecmp(s_mode,
"multi") == 0) {
1401 }
else if (strcasecmp(s_mode,
"normal") != 0) {
1402 FatalError(
"log-pcap: invalid mode \"%s\". Valid options: \"normal\""
1403 "or \"multi\" mode ",
1408 const char *s_dir = NULL;
1410 if (s_dir == NULL) {
1411 const char *log_dir = NULL;
1414 strlcpy(pl->dir, log_dir,
sizeof(pl->dir));
1419 s_dir,
sizeof(pl->dir));
1421 const char *log_dir = NULL;
1424 snprintf(pl->dir,
sizeof(pl->dir),
"%s/%s",
1428 struct stat stat_buf;
1429 if (stat(pl->dir, &stat_buf) != 0) {
1431 "supplied doesn't exist. Shutting down the engine",
1441 if (compression_str == NULL || strcmp(compression_str,
"none") == 0) {
1449 }
else if (strcmp(compression_str,
"lz4") == 0) {
1459 SCLogError(
"SCMalloc failed: %s", strerror(errno));
1465 SCLogError(
"SCFmemopen failed: %s", strerror(errno));
1471 memset(&comp->lz4f_prefs,
'\0',
sizeof(comp->lz4f_prefs));
1472 comp->lz4f_prefs.frameInfo.blockSizeID = LZ4F_max4MB;
1473 comp->lz4f_prefs.frameInfo.blockMode = LZ4F_blockLinked;
1475 comp->lz4f_prefs.frameInfo.contentChecksumFlag = 1;
1478 comp->lz4f_prefs.frameInfo.contentChecksumFlag = 0;
1484 }
else if (lvl < 0) {
1490 comp->lz4f_prefs.compressionLevel = lvl;
1494 LZ4F_errorCode_t errcode =
1495 LZ4F_createCompressionContext(&pl->compression.lz4f_context, 1);
1497 if (LZ4F_isError(errcode)) {
1498 SCLogError(
"LZ4F_createCompressionContext failed: %s", LZ4F_getErrorName(errcode));
1510 "lz4 output buffer.");
1517 pl->suffix =
".lz4";
1520 "in pcap-log, but suricata was not compiled with lz4 "
1522 PcapLogDataFree(pl);
1528 "compression format: %s",
1530 PcapLogDataFree(pl);
1534 SCLogInfo(
"Selected pcap-log compression method: %s",
1535 compression_str ? compression_str :
"none");
1538 if (s_conditional != NULL) {
1539 if (strcasecmp(s_conditional,
"alerts") == 0) {
1542 }
else if (strcasecmp(s_conditional,
"tag") == 0) {
1545 }
else if (strcasecmp(s_conditional,
"all") != 0) {
1546 FatalError(
"log-pcap: invalid conditional \"%s\". Valid options: \"all\", "
1547 "\"alerts\", or \"tag\" mode ",
1553 "Selected pcap-log conditional logging: %s", s_conditional ? s_conditional :
"all");
1556 if (ParseFilename(pl, filename) != 0)
1563 const char *max_number_of_files_s = NULL;
1565 if (max_number_of_files_s != NULL) {
1567 max_number_of_files_s) == -1) {
1569 "pcap-log output, invalid number of files limit: %s",
1570 max_number_of_files_s);
1572 }
else if (max_file_limit < 1) {
1573 FatalError(
"Failed to initialize pcap-log output, limit less than "
1574 "allowed minimum.");
1582 const char *ts_format = NULL;
1586 if (ts_format != NULL) {
1587 if (strcasecmp(ts_format,
"usec") == 0) {
1589 }
else if (strcasecmp(ts_format,
"sec") != 0) {
1590 SCLogError(
"log-pcap ts_format specified %s is invalid must be"
1591 " \"sec\" or \"usec\"",
1597 const char *use_stream_depth = NULL;
1601 if (use_stream_depth != NULL) {
1607 FatalError(
"log-pcap use_stream_depth specified is invalid must be");
1611 const char *honor_pass_rules = NULL;
1615 if (honor_pass_rules != NULL) {
1621 FatalError(
"log-pcap honor-pass-rules specified is invalid");
1628 if (
unlikely(output_ctx == NULL)) {
1629 FatalError(
"Failed to allocate memory for OutputCtx.");
1631 output_ctx->
data = pl;
1632 output_ctx->
DeInit = PcapLogFileDeInitCtx;
1635 result.
ctx = output_ctx;
1640 static void PcapLogFileDeInitCtx(
OutputCtx *output_ctx)
1642 if (output_ctx == NULL)
1651 PcapLogDataFree(pl);
1654 pcre2_code_free(pcre_timestamp_code);
1655 pcre2_match_data_free(pcre_timestamp_match);
1670 char *filename = NULL;
1697 ret = snprintf(filename, PATH_MAX,
"%s/%s.%" PRIu32
"%s", pl->dir, pl->prefix,
1700 ret = snprintf(filename, PATH_MAX,
"%s/%s.%" PRIu32
".%" PRIu32
"%s", pl->dir,
1703 if (ret < 0 || (
size_t)ret >= PATH_MAX) {
1708 if (pl->filename_part_cnt > 0) {
1711 strlcpy(filename, pl->dir, PATH_MAX);
1712 strlcat(filename,
"/", PATH_MAX);
1715 for (i = 0; i < pl->filename_part_cnt; i++) {
1716 if (pl->filename_parts[i] == NULL ||strlen(pl->filename_parts[i]) == 0)
1720 if (pl->filename_parts[i][0] ==
'%') {
1722 if (strlen(pl->filename_parts[i]) < 2)
1725 switch(pl->filename_parts[i][1]) {
1727 snprintf(
str,
sizeof(
str),
"%u", pl->thread_number);
1732 snprintf(
str,
sizeof(
str),
"%"PRIu64, (uint64_t)thread_id);
1740 snprintf(
str,
sizeof(
str),
"%" PRIu32
".%" PRIu32,
1748 strlcat(filename, pl->filename_parts[i], PATH_MAX);
1751 strlcat(filename, pl->suffix, PATH_MAX);
1756 ret = snprintf(filename, PATH_MAX,
"%s/%s.%u.%" PRIu32
"%s", pl->dir, pl->prefix,
1759 ret = snprintf(filename, PATH_MAX,
"%s/%s.%u.%" PRIu32
".%" PRIu32
"%s", pl->dir,
1763 if (ret < 0 || (
size_t)ret >= PATH_MAX) {
1768 SCLogDebug(
"multi-mode: filename %s", filename);
1772 SCLogError(
"Error allocating memory. For filename");
1785 PcapFileNameFree(pf);
1798 static int profiling_pcaplog_enabled = 0;
1799 static int profiling_pcaplog_output_to_file = 0;
1800 static char *profiling_pcaplog_file_name = NULL;
1801 static const char *profiling_pcaplog_file_mode =
"a";
1803 static void FormatNumber(uint64_t num,
char *
str,
size_t size)
1806 snprintf(
str, size,
"%"PRIu64, num);
1807 else if (num < 1000000UL)
1808 snprintf(
str, size,
"%3.1fk", (
float)num/1000UL);
1809 else if (num < 1000000000UL)
1810 snprintf(
str, size,
"%3.1fm", (
float)num/1000000UL);
1812 snprintf(
str, size,
"%3.1fb", (
float)num/1000000000UL);
1817 char ticks_str[32] =
"n/a";
1818 char cnt_str[32] =
"n/a";
1819 char avg_str[32] =
"n/a";
1821 FormatNumber((uint64_t)p->
cnt, cnt_str,
sizeof(cnt_str));
1822 FormatNumber((uint64_t)p->
total, ticks_str,
sizeof(ticks_str));
1824 FormatNumber((uint64_t)(p->
total/p->
cnt), avg_str,
sizeof(avg_str));
1826 fprintf(fp,
"%-28s %-10s %-10s %-10s\n", name, cnt_str, avg_str, ticks_str);
1829 static void ProfileReport(FILE *fp,
PcapLogData *pl)
1834 ProfileReportPair(fp,
"rotate (incl open/close)", &pl->
profile_rotate);
1840 static void FormatBytes(uint64_t num,
char *
str,
size_t size)
1843 snprintf(
str, size,
"%"PRIu64, num);
1844 else if (num < 1048576UL)
1845 snprintf(
str, size,
"%3.1fKiB", (
float)num/1000UL);
1846 else if (num < 1073741824UL)
1847 snprintf(
str, size,
"%3.1fMiB", (
float)num/1000000UL);
1849 snprintf(
str, size,
"%3.1fGiB", (
float)num/1000000000UL);
1856 if (profiling_pcaplog_enabled == 0)
1859 if (profiling_pcaplog_output_to_file == 1) {
1860 fp = fopen(profiling_pcaplog_file_name, profiling_pcaplog_file_mode);
1862 SCLogError(
"failed to open %s: %s", profiling_pcaplog_file_name, strerror(errno));
1870 fprintf(fp,
"\n\nOperation Cnt Avg ticks Total ticks\n");
1871 fprintf(fp,
"---------------------------- ---------- ---------- -----------\n");
1873 ProfileReport(fp, pl);
1880 fprintf(fp,
"\nOverall: %"PRIu64
" bytes written, average %d bytes per write.\n",
1883 fprintf(fp,
" PCAP data structure overhead: %"PRIuMAX
" per write.\n",
1884 (uintmax_t)
sizeof(
struct pcap_pkthdr));
1889 fprintf(fp,
" Size written: %s\n", bytes_str);
1892 uint64_t ticks_per_mib = 0, ticks_per_gib = 0;
1895 ticks_per_mib = total/mib;
1896 char ticks_per_mib_str[32] =
"n/a";
1897 if (ticks_per_mib > 0)
1898 FormatNumber(ticks_per_mib, ticks_per_mib_str,
sizeof(ticks_per_mib_str));
1899 fprintf(fp,
" Ticks per MiB: %s\n", ticks_per_mib_str);
1903 ticks_per_gib = total/gib;
1904 char ticks_per_gib_str[32] =
"n/a";
1905 if (ticks_per_gib > 0)
1906 FormatNumber(ticks_per_gib, ticks_per_gib_str,
sizeof(ticks_per_gib_str));
1907 fprintf(fp,
" Ticks per GiB: %s\n", ticks_per_gib_str);
1917 profiling_pcaplog_enabled = 1;
1918 SCLogInfo(
"pcap-log profiling enabled");
1921 if (filename != NULL) {
1922 const char *log_dir;
1925 profiling_pcaplog_file_name =
SCMalloc(PATH_MAX);
1926 if (
unlikely(profiling_pcaplog_file_name == NULL)) {
1930 snprintf(profiling_pcaplog_file_name, PATH_MAX,
"%s/%s", log_dir, filename);
1934 profiling_pcaplog_file_mode =
"a";
1936 profiling_pcaplog_file_mode =
"w";
1939 profiling_pcaplog_output_to_file = 1;
1940 SCLogInfo(
"pcap-log profiling output goes to %s (mode %s)",
1941 profiling_pcaplog_file_name, profiling_pcaplog_file_mode);