|
|
|
@ -161,8 +161,11 @@ typedef struct AppLayerProtoDetectCtx_ {
|
|
|
|
|
* ipproto. */
|
|
|
|
|
const char *alproto_names[ALPROTO_MAX];
|
|
|
|
|
|
|
|
|
|
/* Protocol expectations, like ftp-data on tcp */
|
|
|
|
|
uint8_t expectation_proto[ALPROTO_MAX];
|
|
|
|
|
/* Protocol expectations, like ftp-data on tcp.
|
|
|
|
|
* It should be allocated to contain ALPROTO_MAX
|
|
|
|
|
* app-layer protocols. For each protocol, an iptype
|
|
|
|
|
* is referenced (or 0 if there is no expectation). */
|
|
|
|
|
uint8_t *expectation_proto;
|
|
|
|
|
} AppLayerProtoDetectCtx;
|
|
|
|
|
|
|
|
|
|
typedef struct AppLayerProtoDetectAliases_ {
|
|
|
|
@ -1721,6 +1724,11 @@ int AppLayerProtoDetectSetup(void)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// to realloc when dynamic protos are added
|
|
|
|
|
alpd_ctx.expectation_proto = SCCalloc(ALPROTO_MAX, sizeof(uint8_t));
|
|
|
|
|
if (unlikely(alpd_ctx.expectation_proto == NULL)) {
|
|
|
|
|
FatalError("Unable to alloc expectation_proto.");
|
|
|
|
|
}
|
|
|
|
|
AppLayerExpectationSetup();
|
|
|
|
|
|
|
|
|
|
SCReturnInt(0);
|
|
|
|
@ -1752,6 +1760,9 @@ int AppLayerProtoDetectDeSetup(void)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SCFree(alpd_ctx.expectation_proto);
|
|
|
|
|
alpd_ctx.expectation_proto = NULL;
|
|
|
|
|
|
|
|
|
|
SpmDestroyGlobalThreadCtx(alpd_ctx.spm_global_thread_ctx);
|
|
|
|
|
|
|
|
|
|
AppLayerProtoDetectFreeAliases();
|
|
|
|
|