pcap: output cleanups

pull/8304/head
Victor Julien 4 years ago
parent 1db4dc4fcb
commit da5fa24ab2

@ -385,8 +385,9 @@ void ReceivePcapFileThreadExitStats(ThreadVars *tv, void *data)
SCLogInfo("1/%" PRIu64 "th of packets have an invalid checksum",
chrate);
}
SCLogNotice("read %" PRIu64 " files, %" PRIu64 " packets, %" PRIu64 " bytes",
ptv->shared.files, ptv->shared.pkts, ptv->shared.bytes);
SCLogNotice("read %" PRIu64 " file%s, %" PRIu64 " packets, %" PRIu64 " bytes",
ptv->shared.files, ptv->shared.files == 1 ? "" : "s", ptv->shared.pkts,
ptv->shared.bytes);
}
}

@ -1422,7 +1422,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
else if(strcmp((long_opts[option_index]).name , "pfring-cluster-id") == 0){
#ifdef HAVE_PFRING
if (ConfSetFinal("pfring.cluster-id", optarg) != 1) {
fprintf(stderr, "ERROR: Failed to set pfring.cluster-id.\n");
SCLogError("failed to set pfring.cluster-id");
return TM_ECODE_FAILED;
}
#else
@ -1434,7 +1434,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
else if(strcmp((long_opts[option_index]).name , "pfring-cluster-type") == 0){
#ifdef HAVE_PFRING
if (ConfSetFinal("pfring.cluster-type", optarg) != 1) {
fprintf(stderr, "ERROR: Failed to set pfring.cluster-type.\n");
SCLogError("failed to set pfring.cluster-type");
return TM_ECODE_FAILED;
}
#else
@ -1637,7 +1637,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
} else if (strcmp((long_opts[option_index]).name, "pcap-buffer-size") == 0) {
#ifdef HAVE_PCAP_SET_BUFF
if (ConfSetFinal("pcap.buffer-size", optarg) != 1) {
fprintf(stderr, "ERROR: Failed to set pcap-buffer-size.\n");
SCLogError("failed to set pcap-buffer-size");
return TM_ECODE_FAILED;
}
#else
@ -1729,7 +1729,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
}
else if (strcmp((long_opts[option_index]).name, "pcap-file-recursive") == 0) {
if (ConfSetFinal("pcap-file.recursive", "true") != 1) {
SCLogError("ERROR: Failed to set pcap-file.recursive");
SCLogError("failed to set pcap-file.recursive");
return TM_ECODE_FAILED;
}
}
@ -1918,7 +1918,7 @@ static TmEcode ParseCommandLine(int argc, char** argv, SCInstance *suri)
struct stat buf;
if (stat(optarg, &buf) != 0) {
#endif /* OS_WIN32 */
SCLogError("ERROR: Pcap file does not exist\n");
SCLogError("pcap file '%s': %s", optarg, strerror(errno));
return TM_ECODE_FAILED;
}
if (ConfSetFinal("pcap-file.file", optarg) != 1) {

@ -295,6 +295,9 @@ static const char *SCTransformModule(const char *module_name, int *dn_len)
} else if (strncmp("util-", module_name, 5) == 0) {
*dn_len = strlen(module_name) - 5;
return module_name + 5;
} else if (strncmp("source-pcap-file", module_name, 16) == 0) {
*dn_len = strlen("pcap");
return "pcap";
} else if (strncmp("source-", module_name, 7) == 0) {
*dn_len = strlen(module_name) - 7;
return module_name + 7;

Loading…
Cancel
Save