71 #define EXPECTATION_TIMEOUT 30
72 #define EXPECTATION_MAX_LEVEL 10
97 static void ExpectationDataFree(
void *e)
111 static void AppLayerFreeExpectation(
Expectation *exp)
115 if (expdata->
DFree) {
124 static void ExpectationListFree(
void *el)
127 if (exp_list == NULL)
130 if (exp_list->length > 0) {
135 AppLayerFreeExpectation(exp);
149 g_ippair_expectation_id =
151 g_flow_expectation_id =
158 memset(ip_src, 0,
sizeof(*ip_src));
159 memset(ip_dst, 0,
sizeof(*ip_dst));
175 if (GetFlowAddresses(f, &ip_src, &ip_dst) == -1)
191 AppLayerFreeExpectation(exp);
194 if (exp_list->length == 0) {
196 ExpectationListFree(exp_list);
239 if (GetFlowAddresses(f, &ip_src, &ip_dst) == -1)
253 AppLayerFreeExpectation(last_exp);
261 exp_list =
SCCalloc(1,
sizeof(*exp_list));
262 if (exp_list == NULL)
264 exp_list->length = 0;
270 exp_list->length += 1;
291 return g_flow_expectation_id;
318 if (exp_list == NULL)
321 time_t ctime = f->
lastts.tv_sec;
325 ((exp->
dp == 0) || (exp->
dp == f->
dp))) {
336 ExpectationDataFree(exp->
data);
344 exp_list = AppLayerExpectationRemove(ipp, exp_list, exp);
345 if (exp_list == NULL)
351 exp_list = AppLayerExpectationRemove(ipp, exp_list, exp);
352 if (exp_list == NULL)
377 if (exp_list == NULL)
382 if (exp->
orig_f == (
void *)f) {
383 exp_list = AppLayerExpectationRemove(ipp, exp_list, exp);
384 if (exp_list == NULL)