From db2d483d11cd762a6dd9e71800e98c7e86ceee6b Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Wed, 13 Jan 2010 21:28:21 +0100 Subject: [PATCH] convert action_type to enum This patch converts packet action type to an enum. This will provide some facilities and ease bad value detection by gcc. --- src/action-globals.h | 14 ++++++++------ src/decode.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/action-globals.h b/src/action-globals.h index be527918fb..5b2a0a527c 100644 --- a/src/action-globals.h +++ b/src/action-globals.h @@ -2,11 +2,13 @@ #ifndef __ACTION_GLOBALS_H__ #define __ACTION_GLOBALS_H__ -#define ACTION_ALERT 0 -#define ACTION_DROP 1 -#define ACTION_REJECT 2 -#define ACTION_REJECT_DST 3 -#define ACTION_REJECT_BOTH 4 -#define ACTION_PASS 5 +typedef enum { + ACTION_ALERT, + ACTION_DROP, + ACTION_REJECT, + ACTION_REJECT_DST, + ACTION_REJECT_BOTH, + ACTION_PASS +} ActionType; #endif /* __ACTION_GLOBALS_H__ */ diff --git a/src/decode.h b/src/decode.h index 26418ee09d..8dceffa39e 100644 --- a/src/decode.h +++ b/src/decode.h @@ -300,7 +300,7 @@ typedef struct Packet_ PacketAlerts alerts; /* IPS action to take */ - int action; + ActionType action; /* double linked list ptrs */ struct Packet_ *next;