-/* Copyright (C) 2007-2013 Open Information Security Foundation
+/* Copyright (C) 2007-2018 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
static int DetectHttpHHSetup(DetectEngineCtx *, Signature *, const char *);
static void DetectHttpHHRegisterTests(void);
-static void DetectHttpHHFree(void *);
static _Bool DetectHttpHostValidateCallback(const Signature *s, const char **sigerror);
static int g_http_host_buffer_id = 0;
{
sigmatch_table[DETECT_AL_HTTP_HOST].name = "http_host";
sigmatch_table[DETECT_AL_HTTP_HOST].desc = "content modifier to match only on the HTTP hostname";
- sigmatch_table[DETECT_AL_HTTP_HOST].Match = NULL;
sigmatch_table[DETECT_AL_HTTP_HOST].Setup = DetectHttpHHSetup;
- sigmatch_table[DETECT_AL_HTTP_HOST].Free = DetectHttpHHFree;
sigmatch_table[DETECT_AL_HTTP_HOST].RegisterTests = DetectHttpHHRegisterTests;
sigmatch_table[DETECT_AL_HTTP_HOST].flags |= SIGMATCH_NOOPT ;
return TRUE;
}
-/**
- * \brief The function to free the http_host data.
- *
- * \param ptr Pointer to the http_host.
- */
-void DetectHttpHHFree(void *ptr)
-{
- DetectContentData *hhhd = (DetectContentData *)ptr;
- if (hhhd == NULL)
- return;
-
- if (hhhd->content != NULL)
- SCFree(hhhd->content);
-
- SpmDestroyCtx(hhhd->spm_ctx);
- SCFree(hhhd);
-
- return;
-}
-
/************************************Unittests*********************************/
#ifdef UNITTESTS
}
end:
- SigGroupCleanup(de_ctx);
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
result = 1;
end:
- SigGroupCleanup(de_ctx);
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
result = 1;
end:
- SigGroupCleanup(de_ctx);
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
result = 1;
end:
- SigGroupCleanup(de_ctx);
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
result = 1;
end:
- SigGroupCleanup(de_ctx);
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- SigGroupCleanup(de_ctx);
- if (de_ctx != NULL)
- SigCleanSignatures(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- SigGroupCleanup(de_ctx);
- if (de_ctx != NULL)
- SigCleanSignatures(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- SigGroupCleanup(de_ctx);
- if (de_ctx != NULL)
- SigCleanSignatures(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- SigGroupCleanup(de_ctx);
- if (de_ctx != NULL)
- SigCleanSignatures(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- SigGroupCleanup(de_ctx);
- if (de_ctx != NULL)
- SigCleanSignatures(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- SigGroupCleanup(de_ctx);
- if (de_ctx != NULL)
- SigCleanSignatures(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- SigGroupCleanup(de_ctx);
- if (de_ctx != NULL)
- SigCleanSignatures(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
end:
if (alp_tctx != NULL)
AppLayerParserThreadCtxFree(alp_tctx);
- if (de_ctx != NULL)
- SigGroupCleanup(de_ctx);
- if (de_ctx != NULL)
- SigCleanSignatures(de_ctx);
if (de_ctx != NULL)
DetectEngineCtxFree(de_ctx);
DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
}
if (de_ctx != NULL) {
- SigGroupCleanup(de_ctx);
DetectEngineCtxFree(de_ctx);
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}
result = 1;
end:
- SigCleanSignatures(de_ctx);
DetectEngineCtxFree(de_ctx);
return result;
}