63 }
else if (action == 0) {
67 for (uint8_t i = 0; i < 4; i++) {
83 static uint8_t ActionAsciiToFlag(
const char *action)
85 if (strcmp(action,
"pass") == 0)
87 if (strcmp(action,
"drop") == 0)
89 if (strcmp(action,
"reject") == 0)
91 if (strcmp(action,
"alert") == 0)
106 uint8_t actions_used = 0;
107 uint8_t action_flag = 0;
108 uint8_t actions_config[4] = {0, 0, 0, 0};
116 if (action_order == NULL) {
123 action_flag = ActionAsciiToFlag(action->
val);
124 if (action_flag == 0) {
125 SCLogError(
"action-order, invalid action: \"%s\". Please, use"
126 " \"pass\",\"drop\",\"alert\",\"reject\". You have"
127 " to specify all of them, without quotes and without"
133 if (actions_used & action_flag) {
134 SCLogError(
"action-order, action already set: \"%s\". Please,"
135 " use \"pass\",\"drop\",\"alert\",\"reject\". You"
136 " have to specify all of them, without quotes and"
137 " without capital letters",
143 SCLogError(
"action-order, you have already specified all the "
144 "possible actions plus \"%s\". Please, use \"pass\","
145 "\"drop\",\"alert\",\"reject\". You have to specify"
146 " all of them, without quotes and without capital"
151 actions_used |= action_flag;
152 actions_config[order++] = action_flag;
156 SCLogError(
"action-order, the config didn't specify all of the "
157 "actions. Please, use \"pass\",\"drop\",\"alert\","
158 "\"reject\". You have to specify all of them, without"
159 " quotes and without capital letters");
164 for (order = 0; order < 4; order++) {
180 static int UtilActionTest01(
void)
216 static int UtilActionTest02(
void)
251 static int UtilActionTest03(
void)
285 static int UtilActionTest04(
void)
317 static int UtilActionTest05(
void)
352 static int UtilActionTest06(
void)
386 static int UtilActionTest07(
void)
421 static int UtilActionTest08(
void)
423 char config[] =
"%YAML 1.1\n"