64 }
else if (action == 0) {
68 for (uint8_t i = 0; i < 4; i++) {
84 static uint8_t ActionAsciiToFlag(
const char *action)
86 if (strcmp(action,
"pass") == 0)
88 if (strcmp(action,
"drop") == 0)
90 if (strcmp(action,
"reject") == 0)
92 if (strcmp(action,
"alert") == 0)
107 uint8_t actions_used = 0;
108 uint8_t action_flag = 0;
109 uint8_t actions_config[4] = {0, 0, 0, 0};
117 if (action_order == NULL) {
124 action_flag = ActionAsciiToFlag(action->
val);
125 if (action_flag == 0) {
126 SCLogError(
"action-order, invalid action: \"%s\". Please, use"
127 " \"pass\",\"drop\",\"alert\",\"reject\". You have"
128 " to specify all of them, without quotes and without"
134 if (actions_used & action_flag) {
135 SCLogError(
"action-order, action already set: \"%s\". Please,"
136 " use \"pass\",\"drop\",\"alert\",\"reject\". You"
137 " have to specify all of them, without quotes and"
138 " without capital letters",
144 SCLogError(
"action-order, you have already specified all the "
145 "possible actions plus \"%s\". Please, use \"pass\","
146 "\"drop\",\"alert\",\"reject\". You have to specify"
147 " all of them, without quotes and without capital"
152 actions_used |= action_flag;
153 actions_config[order++] = action_flag;
157 SCLogError(
"action-order, the config didn't specify all of the "
158 "actions. Please, use \"pass\",\"drop\",\"alert\","
159 "\"reject\". You have to specify all of them, without"
160 " quotes and without capital letters");
165 for (order = 0; order < 4; order++) {
181 static int UtilActionTest01(
void)
215 static int UtilActionTest02(
void)
249 static int UtilActionTest03(
void)
282 static int UtilActionTest04(
void)
313 static int UtilActionTest05(
void)
347 static int UtilActionTest06(
void)
380 static int UtilActionTest07(
void)
414 static int UtilActionTest08(
void)
416 char config[] =
"%YAML 1.1\n"