From 5279c2472d49fd6eb21a78a65552e9925e03826f Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 19 Sep 2014 13:39:37 +0200 Subject: [PATCH] rule parser: set flag for optionless keywords If a keyword doesn't have an argument, it should set the SIGMATCH_NOOPT flag so the parser knows. --- src/detect-dce-stub-data.c | 1 + src/detect-dns-query.c | 1 + src/detect-fast-pattern.c | 1 + src/detect-file-data.c | 1 + src/detect-filestore.c | 1 + src/detect-ftpbounce.c | 1 + src/detect-http-client-body.c | 1 + src/detect-http-cookie.c | 1 + src/detect-http-header.c | 1 + src/detect-http-hh.c | 1 + src/detect-http-hrh.c | 1 + src/detect-http-method.c | 1 + src/detect-http-raw-header.c | 1 + src/detect-http-raw-uri.c | 1 + src/detect-http-server-body.c | 1 + src/detect-http-stat-code.c | 1 + src/detect-http-stat-msg.c | 1 + src/detect-http-ua.c | 1 + src/detect-http-uri.c | 1 + src/detect-pkt-data.c | 1 + src/detect-sameip.c | 1 + 21 files changed, 21 insertions(+) diff --git a/src/detect-dce-stub-data.c b/src/detect-dce-stub-data.c index 2f6f31539e..d5e660ebd4 100644 --- a/src/detect-dce-stub-data.c +++ b/src/detect-dce-stub-data.c @@ -66,6 +66,7 @@ void DetectDceStubDataRegister(void) sigmatch_table[DETECT_DCE_STUB_DATA].Free = NULL; sigmatch_table[DETECT_DCE_STUB_DATA].RegisterTests = DetectDceStubDataRegisterTests; + sigmatch_table[DETECT_DCE_STUB_DATA].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_DCE_STUB_DATA].flags |= SIGMATCH_PAYLOAD; return; diff --git a/src/detect-dns-query.c b/src/detect-dns-query.c index f1e739f658..6bac50f1ec 100644 --- a/src/detect-dns-query.c +++ b/src/detect-dns-query.c @@ -74,6 +74,7 @@ void DetectDnsQueryRegister (void) { sigmatch_table[DETECT_AL_DNS_QUERY].Free = NULL; sigmatch_table[DETECT_AL_DNS_QUERY].RegisterTests = DetectDnsQueryRegisterTests; + sigmatch_table[DETECT_AL_DNS_QUERY].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_DNS_QUERY].flags |= SIGMATCH_PAYLOAD; } diff --git a/src/detect-fast-pattern.c b/src/detect-fast-pattern.c index a71f23bbb4..a54103e65e 100644 --- a/src/detect-fast-pattern.c +++ b/src/detect-fast-pattern.c @@ -161,6 +161,7 @@ void DetectFastPatternRegister(void) sigmatch_table[DETECT_FAST_PATTERN].Free = NULL; sigmatch_table[DETECT_FAST_PATTERN].RegisterTests = DetectFastPatternRegisterTests; + sigmatch_table[DETECT_FAST_PATTERN].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_FAST_PATTERN].flags |= SIGMATCH_PAYLOAD; const char *eb; diff --git a/src/detect-file-data.c b/src/detect-file-data.c index f1b8057906..5838370d8c 100644 --- a/src/detect-file-data.c +++ b/src/detect-file-data.c @@ -58,6 +58,7 @@ void DetectFiledataRegister(void) { sigmatch_table[DETECT_FILE_DATA].Setup = DetectFiledataSetup; sigmatch_table[DETECT_FILE_DATA].Free = NULL; sigmatch_table[DETECT_FILE_DATA].RegisterTests = NULL; + sigmatch_table[DETECT_FILE_DATA].flags = SIGMATCH_NOOPT; } /** diff --git a/src/detect-filestore.c b/src/detect-filestore.c index f4b046ce95..bbbaa964b2 100644 --- a/src/detect-filestore.c +++ b/src/detect-filestore.c @@ -76,6 +76,7 @@ void DetectFilestoreRegister(void) { sigmatch_table[DETECT_FILESTORE].Setup = DetectFilestoreSetup; sigmatch_table[DETECT_FILESTORE].Free = DetectFilestoreFree; sigmatch_table[DETECT_FILESTORE].RegisterTests = NULL; + sigmatch_table[DETECT_FILESTORE].flags = SIGMATCH_NOOPT; const char *eb; int eo; diff --git a/src/detect-ftpbounce.c b/src/detect-ftpbounce.c index c9942816b6..0269f33f1b 100644 --- a/src/detect-ftpbounce.c +++ b/src/detect-ftpbounce.c @@ -70,6 +70,7 @@ void DetectFtpbounceRegister(void) sigmatch_table[DETECT_FTPBOUNCE].alproto = ALPROTO_FTP; sigmatch_table[DETECT_FTPBOUNCE].Free = NULL; sigmatch_table[DETECT_FTPBOUNCE].RegisterTests = DetectFtpbounceRegisterTests; + sigmatch_table[DETECT_FTPBOUNCE].flags = SIGMATCH_NOOPT; return; } diff --git a/src/detect-http-client-body.c b/src/detect-http-client-body.c index 33c0a8ecfc..89e8fd1a93 100644 --- a/src/detect-http-client-body.c +++ b/src/detect-http-client-body.c @@ -76,6 +76,7 @@ void DetectHttpClientBodyRegister(void) sigmatch_table[DETECT_AL_HTTP_CLIENT_BODY].RegisterTests = DetectHttpClientBodyRegisterTests; sigmatch_table[DETECT_AL_HTTP_CLIENT_BODY].alproto = ALPROTO_HTTP; + sigmatch_table[DETECT_AL_HTTP_CLIENT_BODY].flags |= SIGMATCH_NOOPT ; sigmatch_table[DETECT_AL_HTTP_CLIENT_BODY].flags |= SIGMATCH_PAYLOAD ; } diff --git a/src/detect-http-cookie.c b/src/detect-http-cookie.c index 3a1e0c589a..c870a196f2 100644 --- a/src/detect-http-cookie.c +++ b/src/detect-http-cookie.c @@ -79,6 +79,7 @@ void DetectHttpCookieRegister(void) sigmatch_table[DETECT_AL_HTTP_COOKIE].Free = DetectHttpCookieFree; sigmatch_table[DETECT_AL_HTTP_COOKIE].RegisterTests = DetectHttpCookieRegisterTests; + sigmatch_table[DETECT_AL_HTTP_COOKIE].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_COOKIE].flags |= SIGMATCH_PAYLOAD; } diff --git a/src/detect-http-header.c b/src/detect-http-header.c index 63935727e6..8f902cc9ae 100644 --- a/src/detect-http-header.c +++ b/src/detect-http-header.c @@ -78,6 +78,7 @@ void DetectHttpHeaderRegister(void) sigmatch_table[DETECT_AL_HTTP_HEADER].RegisterTests = DetectHttpHeaderRegisterTests; sigmatch_table[DETECT_AL_HTTP_HEADER].alproto = ALPROTO_HTTP; + sigmatch_table[DETECT_AL_HTTP_HEADER].flags |= SIGMATCH_NOOPT ; sigmatch_table[DETECT_AL_HTTP_HEADER].flags |= SIGMATCH_PAYLOAD ; return; diff --git a/src/detect-http-hh.c b/src/detect-http-hh.c index c5a052b637..4df0fe329a 100644 --- a/src/detect-http-hh.c +++ b/src/detect-http-hh.c @@ -76,6 +76,7 @@ void DetectHttpHHRegister(void) sigmatch_table[DETECT_AL_HTTP_HOST].RegisterTests = DetectHttpHHRegisterTests; sigmatch_table[DETECT_AL_HTTP_HOST].alproto = ALPROTO_HTTP; + sigmatch_table[DETECT_AL_HTTP_HOST].flags |= SIGMATCH_NOOPT ; sigmatch_table[DETECT_AL_HTTP_HOST].flags |= SIGMATCH_PAYLOAD ; return; diff --git a/src/detect-http-hrh.c b/src/detect-http-hrh.c index 0fc08b228a..fd15544c37 100644 --- a/src/detect-http-hrh.c +++ b/src/detect-http-hrh.c @@ -76,6 +76,7 @@ void DetectHttpHRHRegister(void) sigmatch_table[DETECT_AL_HTTP_RAW_HOST].RegisterTests = DetectHttpHRHRegisterTests; sigmatch_table[DETECT_AL_HTTP_RAW_HOST].alproto = ALPROTO_HTTP; + sigmatch_table[DETECT_AL_HTTP_RAW_HOST].flags |= SIGMATCH_NOOPT ; sigmatch_table[DETECT_AL_HTTP_RAW_HOST].flags |= SIGMATCH_PAYLOAD ; return; diff --git a/src/detect-http-method.c b/src/detect-http-method.c index 347131d44a..68c3014b1c 100644 --- a/src/detect-http-method.c +++ b/src/detect-http-method.c @@ -77,6 +77,7 @@ void DetectHttpMethodRegister(void) { sigmatch_table[DETECT_AL_HTTP_METHOD].Setup = DetectHttpMethodSetup; sigmatch_table[DETECT_AL_HTTP_METHOD].Free = DetectHttpMethodFree; sigmatch_table[DETECT_AL_HTTP_METHOD].RegisterTests = DetectHttpMethodRegisterTests; + sigmatch_table[DETECT_AL_HTTP_METHOD].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_METHOD].flags |= SIGMATCH_PAYLOAD; SCLogDebug("registering http_method rule option"); diff --git a/src/detect-http-raw-header.c b/src/detect-http-raw-header.c index c0672d610a..61e2f153c1 100644 --- a/src/detect-http-raw-header.c +++ b/src/detect-http-raw-header.c @@ -76,6 +76,7 @@ void DetectHttpRawHeaderRegister(void) sigmatch_table[DETECT_AL_HTTP_RAW_HEADER].RegisterTests = DetectHttpRawHeaderRegisterTests; sigmatch_table[DETECT_AL_HTTP_RAW_HEADER].alproto = ALPROTO_HTTP; + sigmatch_table[DETECT_AL_HTTP_RAW_HEADER].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_RAW_HEADER].flags |= SIGMATCH_PAYLOAD; return; diff --git a/src/detect-http-raw-uri.c b/src/detect-http-raw-uri.c index 3e60f1ef53..7cedd89271 100644 --- a/src/detect-http-raw-uri.c +++ b/src/detect-http-raw-uri.c @@ -71,6 +71,7 @@ void DetectHttpRawUriRegister(void) sigmatch_table[DETECT_AL_HTTP_RAW_URI].Setup = DetectHttpRawUriSetup; sigmatch_table[DETECT_AL_HTTP_RAW_URI].Free = NULL; sigmatch_table[DETECT_AL_HTTP_RAW_URI].RegisterTests = DetectHttpRawUriRegisterTests; + sigmatch_table[DETECT_AL_HTTP_RAW_URI].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_RAW_URI].flags |= SIGMATCH_PAYLOAD; return; diff --git a/src/detect-http-server-body.c b/src/detect-http-server-body.c index 4e74bfcdab..b15baa51d2 100644 --- a/src/detect-http-server-body.c +++ b/src/detect-http-server-body.c @@ -78,6 +78,7 @@ void DetectHttpServerBodyRegister(void) sigmatch_table[DETECT_AL_HTTP_SERVER_BODY].RegisterTests = DetectHttpServerBodyRegisterTests; sigmatch_table[DETECT_AL_HTTP_SERVER_BODY].alproto = ALPROTO_HTTP; + sigmatch_table[DETECT_AL_HTTP_SERVER_BODY].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_SERVER_BODY].flags |= SIGMATCH_PAYLOAD ; } diff --git a/src/detect-http-stat-code.c b/src/detect-http-stat-code.c index e41cd16f89..c686c082d2 100644 --- a/src/detect-http-stat-code.c +++ b/src/detect-http-stat-code.c @@ -83,6 +83,7 @@ void DetectHttpStatCodeRegister (void) { sigmatch_table[DETECT_AL_HTTP_STAT_CODE].Free = NULL; sigmatch_table[DETECT_AL_HTTP_STAT_CODE].RegisterTests = DetectHttpStatCodeRegisterTests; + sigmatch_table[DETECT_AL_HTTP_STAT_CODE].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_STAT_CODE].flags |= SIGMATCH_PAYLOAD; } diff --git a/src/detect-http-stat-msg.c b/src/detect-http-stat-msg.c index 1654915e3b..1ab3dc1053 100644 --- a/src/detect-http-stat-msg.c +++ b/src/detect-http-stat-msg.c @@ -83,6 +83,7 @@ void DetectHttpStatMsgRegister (void) { sigmatch_table[DETECT_AL_HTTP_STAT_MSG].Free = NULL; sigmatch_table[DETECT_AL_HTTP_STAT_MSG].RegisterTests = DetectHttpStatMsgRegisterTests; + sigmatch_table[DETECT_AL_HTTP_STAT_MSG].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_STAT_MSG].flags |= SIGMATCH_PAYLOAD; } diff --git a/src/detect-http-ua.c b/src/detect-http-ua.c index ee92e4d712..e335aeb101 100644 --- a/src/detect-http-ua.c +++ b/src/detect-http-ua.c @@ -77,6 +77,7 @@ void DetectHttpUARegister(void) sigmatch_table[DETECT_AL_HTTP_USER_AGENT].RegisterTests = DetectHttpUARegisterTests; sigmatch_table[DETECT_AL_HTTP_USER_AGENT].alproto = ALPROTO_HTTP; + sigmatch_table[DETECT_AL_HTTP_USER_AGENT].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_USER_AGENT].flags |= SIGMATCH_PAYLOAD ; return; diff --git a/src/detect-http-uri.c b/src/detect-http-uri.c index 5747d5d56b..1a322ae463 100644 --- a/src/detect-http-uri.c +++ b/src/detect-http-uri.c @@ -72,6 +72,7 @@ void DetectHttpUriRegister (void) { sigmatch_table[DETECT_AL_HTTP_URI].Free = NULL; sigmatch_table[DETECT_AL_HTTP_URI].RegisterTests = DetectHttpUriRegisterTests; + sigmatch_table[DETECT_AL_HTTP_URI].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_AL_HTTP_URI].flags |= SIGMATCH_PAYLOAD; } diff --git a/src/detect-pkt-data.c b/src/detect-pkt-data.c index c159a0ff1b..dc34b55433 100644 --- a/src/detect-pkt-data.c +++ b/src/detect-pkt-data.c @@ -57,6 +57,7 @@ void DetectPktDataRegister(void) { sigmatch_table[DETECT_PKT_DATA].Setup = DetectPktDataSetup; sigmatch_table[DETECT_PKT_DATA].Free = NULL; sigmatch_table[DETECT_PKT_DATA].RegisterTests = DetectPktDataTestRegister; + sigmatch_table[DETECT_PKT_DATA].flags = SIGMATCH_NOOPT; } /** diff --git a/src/detect-sameip.c b/src/detect-sameip.c index 7cd71d3650..db17e21599 100644 --- a/src/detect-sameip.c +++ b/src/detect-sameip.c @@ -55,6 +55,7 @@ void DetectSameipRegister(void) sigmatch_table[DETECT_SAMEIP].Setup = DetectSameipSetup; sigmatch_table[DETECT_SAMEIP].Free = NULL; sigmatch_table[DETECT_SAMEIP].RegisterTests = DetectSameipRegisterTests; + sigmatch_table[DETECT_SAMEIP].flags = SIGMATCH_NOOPT; } /** -- 2.47.3