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);
}
}
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
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
} 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
}
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;
}
}
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) {
} 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;