Fix pfring commandline handling.

remotes/origin/master-1.1.x
Victor Julien 14 years ago
parent 778b92ef40
commit cd75201dc7

@ -74,7 +74,7 @@ int RunModeErfDagAuto(DetectEngineCtx *de_ctx)
RunModeInitialize();
char *iface = NULL;
if (ConfGet("runmode_erf_dag.iface", &iface) == 0) {
if (ConfGet("erf_dag.iface", &iface) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving pcap_file from Conf");
exit(EXIT_FAILURE);
}

@ -66,8 +66,8 @@ int RunModeErfFileAuto(DetectEngineCtx *de_ctx)
RunModeInitialize();
char *file = NULL;
if (ConfGet("runmode_erf_file.file", &file) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving runmode_erf_file.file "
if (ConfGet("erf_file.file", &file) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving erf_file.file "
"from Conf");
exit(EXIT_FAILURE);
}

@ -70,7 +70,7 @@ void RunModeFilePcapRegister(void)
int RunModeFilePcap2(DetectEngineCtx *de_ctx)
{
char *file = NULL;
if (ConfGet("runmode_pcap_file.file", &file) == 0) {
if (ConfGet("pcap_file.file", &file) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving pcap_file from Conf");
exit(EXIT_FAILURE);
}
@ -155,7 +155,7 @@ int RunModeFilePcapAuto(DetectEngineCtx *de_ctx)
uint16_t ncpus = UtilCpuGetNumProcessorsOnline();
char *file = NULL;
if (ConfGet("runmode_pcap_file.file", &file) == 0) {
if (ConfGet("pcap_file.file", &file) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving pcap_file from Conf");
exit(EXIT_FAILURE);
}
@ -450,7 +450,7 @@ int RunModeFilePcapAutoFp(DetectEngineCtx *de_ctx)
printf("queues %s\n", queues);
char *file = NULL;
if (ConfGet("runmode_pcap_file.file", &file) == 0) {
if (ConfGet("pcap_file.file", &file) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving pcap_file from Conf");
exit(EXIT_FAILURE);
}

@ -90,9 +90,9 @@ int RunModeIdsPcapAuto(DetectEngineCtx *de_ctx)
if (npcap == 1) {
char *pcap_dev = NULL;
if (ConfGet("runmode_pcap.single_pcap_dev", &pcap_dev) == 0) {
if (ConfGet("pcap.single_pcap_dev", &pcap_dev) == 0) {
SCLogError(SC_ERR_RUNMODE, "Failed retrieving "
"runmode_pcap.single_pcap_dev from Conf");
"pcap.single_pcap_dev from Conf");
exit(EXIT_FAILURE);
}
SCLogDebug("pcap_dev %s", pcap_dev);

@ -290,7 +290,7 @@ TmEcode ReceiveIPFWThreadInit(ThreadVars *tv, void *initdata, void **data) {
SCEnter();
/* divert socket port to listen/send on */
if ( (ConfGet("runmode_ipfw.ipfw_divert_port", &tmpdivertport)) != 1 ) {
if ( (ConfGet("ipfw.ipfw_divert_port", &tmpdivertport)) != 1 ) {
SCLogError(SC_ERR_IPFW_NOPORT,"Please supply an IPFW divert port");
SCReturnInt(TM_ECODE_FAILED);

@ -598,8 +598,8 @@ int main(int argc, char **argv)
#ifdef HAVE_PFRING
run_mode = RUNMODE_PFRING;
if (optarg != NULL) {
if (ConfSet("runmode_pfring.interface", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set runmode_pfring.interface.\n");
if (ConfSet("pfring.interface", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set pfring.interface.\n");
exit(EXIT_FAILURE);
}
}
@ -611,8 +611,8 @@ int main(int argc, char **argv)
}
else if(strcmp((long_opts[option_index]).name , "pfring-cluster-id") == 0){
#ifdef HAVE_PFRING
if (ConfSet("runmode_pfring.cluster_id", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set runmode_pfring.cluster_id.\n");
if (ConfSet("pfring.cluster-id", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set pfring.cluster-id.\n");
exit(EXIT_FAILURE);
}
#else
@ -623,8 +623,8 @@ int main(int argc, char **argv)
}
else if(strcmp((long_opts[option_index]).name , "pfring-cluster-type") == 0){
#ifdef HAVE_PFRING
if (ConfSet("runmode_pfring.cluster_type", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set runmode_pfring.cluster_type.\n");
if (ConfSet("pfring.cluster-type", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set pfring.cluster-type.\n");
exit(EXIT_FAILURE);
}
#else
@ -720,16 +720,16 @@ int main(int argc, char **argv)
}
else if (strcmp((long_opts[option_index]).name, "erf-in") == 0) {
run_mode = RUNMODE_ERF_FILE;
if (ConfSet("runmode_erf_file.file", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set runmode_erf_file.file\n");
if (ConfSet("erf_file.file", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set erf_file.file\n");
exit(EXIT_FAILURE);
}
}
else if (strcmp((long_opts[option_index]).name, "dag") == 0) {
#ifdef HAVE_DAG
run_mode = RUNMODE_DAG;
if (ConfSet("runmode_erf_dag.iface", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set runmode_erf_dag.iface\n");
if (ConfSet("erf_dag.iface", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set erf_dag.iface\n");
exit(EXIT_FAILURE);
}
#else
@ -833,7 +833,7 @@ int main(int argc, char **argv)
usage(argv[0]);
exit(EXIT_SUCCESS);
}
if (ConfSet("runmode_ipfw.ipfw_divert_port", optarg, 0) != 1) {
if (ConfSet("ipfw.ipfw_divert_port", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set ipfw_divert_port\n");
exit(EXIT_FAILURE);
}
@ -851,8 +851,8 @@ int main(int argc, char **argv)
usage(argv[0]);
exit(EXIT_SUCCESS);
}
if (ConfSet("runmode_pcap_file.file", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set runmode_pcap_file.file\n");
if (ConfSet("pcap_file.file", optarg, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set pcap_file.file\n");
exit(EXIT_FAILURE);
}
break;
@ -1304,8 +1304,8 @@ int main(int argc, char **argv)
/* run the selected runmode */
if (run_mode == RUNMODE_PCAP_DEV) {
PcapTranslateIPToDevice(pcap_dev, sizeof(pcap_dev));
if (ConfSet("runmode_pcap.single_pcap_dev", pcap_dev, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set runmode_pcap.single_pcap_dev\n");
if (ConfSet("pcap.single_pcap_dev", pcap_dev, 0) != 1) {
fprintf(stderr, "ERROR: Failed to set pcap.single_pcap_dev\n");
exit(EXIT_FAILURE);
}
#ifdef HAVE_PFRING

Loading…
Cancel
Save