Project

General

Profile

Bug #64 ยป 0001-bug-64-patch.patch

Gurvinder Singh, 02/04/2010 02:38 PM

View differences:

src/suricata.c
exit(EXIT_SUCCESS);
break;
case 'i':
run_mode = MODE_PCAP_DEV;
if (run_mode == MODE_UNKNOWN) {
run_mode = MODE_PCAP_DEV;
} else {
SCLogError(SC_ERR_MULTIPLE_RUN_MODE, "more than one run mode "
"has been specified");
usage(argv[0]);
exit(EXIT_FAILURE);
}
pcap_dev = optarg;
break;
case 'l':
......
}
break;
case 'q':
run_mode = MODE_NFQ;
if (run_mode == MODE_UNKNOWN) {
run_mode = MODE_NFQ;
} else {
SCLogError(SC_ERR_MULTIPLE_RUN_MODE, "more than one run mode "
"has been specified");
usage(argv[0]);
exit(EXIT_SUCCESS);
}
nfq_id = atoi(optarg); /* strtol? */
break;
case 'r':
run_mode = MODE_PCAP_FILE;
if (run_mode == MODE_UNKNOWN) {
run_mode = MODE_PCAP_FILE;
} else {
SCLogError(SC_ERR_MULTIPLE_RUN_MODE, "more than one run mode "
"has been specified");
usage(argv[0]);
exit(EXIT_SUCCESS);
}
pcap_file = optarg;
break;
case 's':
......
break;
case 'u':
#ifdef UNITTESTS
run_mode = MODE_UNITTEST;
if (run_mode == MODE_UNKNOWN) {
run_mode = MODE_UNITTEST;
} else {
SCLogError(SC_ERR_MULTIPLE_RUN_MODE, "more than one run mode has"
" been specified");
usage(argv[0]);
exit(EXIT_SUCCESS);
}
#else
fprintf(stderr, "ERROR: Unit tests not enabled. Make sure to pass --enable-unittests to configure when building.\n");
exit(EXIT_FAILURE);
src/util-error.c
CASE_CODE (SC_ERR_MISSING_QUOTE);
CASE_CODE (SC_ERR_UNKNOWN_PROTOCOL);
CASE_CODE (SC_ERR_UNKNOWN_RUN_MODE);
CASE_CODE (SC_ERR_MULTIPLE_RUN_MODE);
default:
return "UNKNOWN_ERROR";
src/util-error.h
SC_REPUTATION_INVALID_OPERATION,
SC_REPUTATION_INVALID_TYPE,
SC_ERR_UNKNOWN_PROTOCOL,
SC_ERR_UNKNOWN_RUN_MODE
SC_ERR_UNKNOWN_RUN_MODE,
SC_ERR_MULTIPLE_RUN_MODE
} SCError;
const char *SCErrorToString(SCError);
    (1-1/1)