summaryrefslogtreecommitdiff
path: root/src/rost.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-01-28 21:27:09 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-01-28 21:27:09 (GMT)
commit24945cea340b7b0ca0fe2ccad7b67519dda1c1bd (patch)
tree97ad3364db5f5f5ab0574310c061f75f42418f0c /src/rost.c
parent3231349bac6aae1f236416a8a51f41caccc38961 (diff)
Implement a basic support for Hyperscan.
Diffstat (limited to 'src/rost.c')
-rw-r--r--src/rost.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/rost.c b/src/rost.c
index d397a2c..4a052c3 100644
--- a/src/rost.c
+++ b/src/rost.c
@@ -39,8 +39,9 @@
#include "analysis/scan/core.h"
#include "analysis/scan/options.h"
#include "analysis/scan/scanner.h"
-#include "analysis/scan/patterns/backends/bitap.h"
#include "analysis/scan/patterns/backends/acism.h"
+#include "analysis/scan/patterns/backends/bitap.h"
+#include "analysis/scan/patterns/backends/hyperscan.h"
#include "core/core.h"
#include "core/global.h"
#include "core/logs.h"
@@ -92,7 +93,7 @@ static void show_rost_help(const char *name)
printf("\n");
- printf("\t-A --algorithm=NAME\tSelect one of the available algorithms for data: bitmap, acism (default: acsim).\n");
+ printf("\t-A --algorithm=NAME\tSelect one of the available algorithms for data: acism, bitmap, hyperscan (default: acsim).\n");
printf("\t-C --check-only\t\tValidate the rule syntax without performing a scan (discard the file/dir argument).\n");
printf("\t-j --print-json\t\tPrint matching strings in JSON format instead of simple text.\n");
printf("\t-s --print-strings\tPrint matching strings (default text format only).\n");
@@ -298,10 +299,12 @@ int main(int argc, char **argv)
break;
case 'A':
- if (strcmp(optarg, "bitmap") == 0)
- g_scan_options_set_backend_for_data(options, G_TYPE_BITAP_BACKEND);
- else if (strcmp(optarg, "acism") == 0)
+ if (strcmp(optarg, "acism") == 0)
g_scan_options_set_backend_for_data(options, G_TYPE_ACISM_BACKEND);
+ else if (strcmp(optarg, "bitmap") == 0)
+ g_scan_options_set_backend_for_data(options, G_TYPE_BITAP_BACKEND);
+ else if (strcmp(optarg, "hyperscan") == 0)
+ g_scan_options_set_backend_for_data(options, G_TYPE_HYPERSCAN_BACKEND);
else
g_scan_options_set_backend_for_data(options, G_TYPE_INVALID);
break;