77 static uint8_t ActionAsciiToFlag(
const char *action)
79 if (strcmp(action,
"pass") == 0)
81 if (strcmp(action,
"drop") == 0)
83 if (strcmp(action,
"reject") == 0)
85 if (strcmp(action,
"alert") == 0)
100 uint8_t actions_used = 0;
101 uint8_t action_flag = 0;
102 uint8_t actions_config[4] = {0, 0, 0, 0};
110 if (action_order == NULL) {
117 action_flag = ActionAsciiToFlag(action->
val);
118 if (action_flag == 0) {
119 SCLogError(
"action-order, invalid action: \"%s\". Please, use"
120 " \"pass\",\"drop\",\"alert\",\"reject\". You have"
121 " to specify all of them, without quotes and without"
127 if (actions_used & action_flag) {
128 SCLogError(
"action-order, action already set: \"%s\". Please,"
129 " use \"pass\",\"drop\",\"alert\",\"reject\". You"
130 " have to specify all of them, without quotes and"
131 " without capital letters",
137 SCLogError(
"action-order, you have already specified all the "
138 "possible actions plus \"%s\". Please, use \"pass\","
139 "\"drop\",\"alert\",\"reject\". You have to specify"
140 " all of them, without quotes and without capital"
145 actions_used |= action_flag;
146 actions_config[order++] = action_flag;
150 SCLogError(
"action-order, the config didn't specify all of the "
151 "actions. Please, use \"pass\",\"drop\",\"alert\","
152 "\"reject\". You have to specify all of them, without"
153 " quotes and without capital letters");
158 for (order = 0; order < 4; order++) {
174 static int UtilActionTest01(
void)
208 static int UtilActionTest02(
void)
242 static int UtilActionTest03(
void)
275 static int UtilActionTest04(
void)
306 static int UtilActionTest05(
void)
340 static int UtilActionTest06(
void)
373 static int UtilActionTest07(
void)
407 static int UtilActionTest08(
void)
409 char config[] =
"%YAML 1.1\n"