29static int IMAPRegisterPatternsForProtocolDetection(
void)
32 IPPROTO_TCP,
ALPROTO_IMAP,
"* OK ", 5, 0, STREAM_TOCLIENT) < 0) {
37 IPPROTO_TCP,
ALPROTO_IMAP,
"* NO ", 5, 0, STREAM_TOCLIENT) < 0) {
42 IPPROTO_TCP,
ALPROTO_IMAP,
"* BAD ", 6, 0, STREAM_TOCLIENT) < 0) {
47 IPPROTO_TCP,
ALPROTO_IMAP,
"* LIST ", 7, 0, STREAM_TOCLIENT) < 0) {
52 IPPROTO_TCP,
ALPROTO_IMAP,
"* ESEARCH ", 10, 0, STREAM_TOCLIENT) < 0) {
57 IPPROTO_TCP,
ALPROTO_IMAP,
"* STATUS ", 9, 0, STREAM_TOCLIENT) < 0) {
62 IPPROTO_TCP,
ALPROTO_IMAP,
"* FLAGS ", 8, 0, STREAM_TOCLIENT) < 0) {
77 17 , 0, STREAM_TOSERVER) < 0) {
86 const char *proto_name =
"imap";
89 SCLogDebug(
"IMAP protocol detection is enabled.");
91 if (IMAPRegisterPatternsForProtocolDetection() < 0)
92 SCLogError(
"Failed to register IMAP protocol detection patterns.");
94 SCLogDebug(
"Protocol detector and parser disabled for IMAP.");
void AppLayerProtoDetectRegisterProtocol(AppProto alproto, const char *alproto_name)
Registers a protocol for protocol detection phase.
int SCAppLayerProtoDetectPMRegisterPatternCI(uint8_t ipproto, AppProto alproto, const char *pattern, uint16_t depth, uint16_t offset, uint8_t direction)
Registers a case-insensitive pattern for protocol detection.
int SCAppLayerProtoDetectConfProtoDetectionEnabled(const char *ipproto, const char *alproto)
Given a protocol name, checks if proto detection is enabled in the conf file.
void RegisterIMAPParsers(void)
#define SCLogError(...)
Macro used to log ERROR messages.