instance: use enum for runmode

pull/2131/head
Victor Julien 10 years ago
parent 2412681eff
commit d39e5754e6

@ -24,7 +24,7 @@
#define __RUNMODES_H__
/* Run mode */
enum {
enum RunModes {
RUNMODE_UNKNOWN = 0,
RUNMODE_PCAP_DEV,
RUNMODE_PCAP_FILE,

@ -2110,6 +2110,8 @@ static int FinalizeRunMode(SCInstance *suri, char **argv)
case RUNMODE_UNKNOWN:
usage(argv[0]);
return TM_ECODE_FAILED;
default:
break;
}
/* Set the global run mode */
run_mode = suri->run_mode;

@ -119,6 +119,8 @@ enum {
#define IS_SURI_HOST_MODE_SNIFFER_ONLY(host_mode) ((host_mode) == SURI_HOST_IS_SNIFFER_ONLY)
#define IS_SURI_HOST_MODE_ROUTER(host_mode) ((host_mode) == SURI_HOST_IS_ROUTER)
#include "runmodes.h"
/* queue's between various other threads
* XXX move to the TmQueue structure later
*/
@ -127,7 +129,7 @@ PacketQueue trans_q[256];
SCDQDataQueue data_queues[256];
typedef struct SCInstance_ {
int run_mode;
enum RunModes run_mode;
char pcap_dev[128];
char *sig_file;

Loading…
Cancel
Save