]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
NFA API: Remove nfaBlockExecReverse scratch arg
authorJustin Viiret <justin.viiret@intel.com>
Thu, 11 Feb 2016 05:46:15 +0000 (16:46 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 1 Mar 2016 00:34:38 +0000 (11:34 +1100)
Scratch is no longer used by this function's implementations.

src/nfa/limex.h
src/nfa/limex_runtime_impl.h
src/nfa/nfa_api.h
src/nfa/nfa_api_dispatch.c
src/som/som_runtime.c
unit/internal/limex_nfa.cpp

index 3f1e49a3c1a41e1ad8aa623b6cc9849ac9448fa4..2c429a67732717029bb0f8eee6e2b12ae800bb02 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -65,14 +65,13 @@ extern "C"
                                        void *state, u8 key);                   \
     char gf_name##_B_Reverse(const struct NFA *n, u64a offset, const u8 *buf,  \
                              size_t buflen, const u8 *hbuf, size_t hlen,       \
-                             struct hs_scratch *scratch, NfaCallback cb,       \
-                             void *context);                                   \
+                             NfaCallback cb, void *context);                   \
     char gf_name##_queueCompressState(const struct NFA *nfa,                   \
                                       const struct mq *q, s64a loc);           \
     char gf_name##_expandState(const struct NFA *nfa, void *dest,              \
                                const void *src, u64a offset, u8 key);          \
-    enum nfa_zombie_status gf_name##_zombie_status(const struct NFA *nfa,    \
-                                                   struct mq *q, s64a loc); \
+    enum nfa_zombie_status gf_name##_zombie_status(const struct NFA *nfa,      \
+                                                   struct mq *q, s64a loc);    \
     GENERATE_NFA_DUMP_DECL(gf_name)
 
 GENERATE_NFA_DECL(nfaExecLimEx32_1)
index e362baef9f204354768b87bea4fc53dc680e09f2..011913f942b252b617612dd42b62ea4e2737b777 100644 (file)
@@ -811,7 +811,6 @@ char JOIN(LIMEX_API_ROOT, _reportCurrent)(const struct NFA *n, struct mq *q) {
 char JOIN(LIMEX_API_ROOT, _B_Reverse)(const struct NFA *n, u64a offset,
                                       const u8 *buf, size_t buflen,
                                       const u8 *hbuf, size_t hlen,
-                                      UNUSED struct hs_scratch *scratch,
                                       NfaCallback cb, void *context) {
     assert(buf || hbuf);
     assert(buflen || hlen);
index 84a5417b5989e6abba4216a62d73e4e0611ec111..84f5c4a01ae46ed27d5cc53f0f8ee36e81872500 100644 (file)
@@ -44,7 +44,6 @@ extern "C"
 #include "callback.h"
 #include "ue2common.h"
 
-struct hs_scratch;
 struct mq;
 struct NFA;
 
@@ -212,16 +211,12 @@ char nfaQueueExecRose(const struct NFA *nfa, struct mq *q, ReportID report);
  * @param buflen length of buf
  * @param hbuf history buf
  * @param hlen length of hbuf
- * @param scratch scratch
  * @param callback the callback to call for each match raised
  * @param context context pointer passed to each callback
- *
- * Note: is NOT reentrant
  */
 char nfaBlockExecReverse(const struct NFA *nfa, u64a offset, const u8 *buf,
                          size_t buflen, const u8 *hbuf, size_t hlen,
-                         struct hs_scratch *scratch, NfaCallback callback,
-                         void *context);
+                         NfaCallback callback, void *context);
 
 /**
  * Check whether the given NFA's state indicates that it is in one or more
index 0c765b36b148174d4d833459bdb3fad539cd1006..fb27e4ebb43ddcbdbb0ca4663533d4529f1974d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -332,13 +332,12 @@ char nfaQueueExecRose(const struct NFA *nfa, struct mq *q, ReportID r) {
 
 char nfaBlockExecReverse(const struct NFA *nfa, u64a offset, const u8 *buf,
                          size_t buflen, const u8 *hbuf, size_t hlen,
-                         struct hs_scratch *scratch, NfaCallback callback,
-                         void *context) {
+                         NfaCallback callback, void *context) {
     assert(nfa);
     assert(ISALIGNED_CL(nfa) && ISALIGNED_CL(getImplNfa(nfa)));
 
     DISPATCH_BY_NFA_TYPE(_B_Reverse(nfa, offset, buf, buflen, hbuf, hlen,
-                                    scratch, callback, context));
+                                    callback, context));
     return 0;
 }
 
index 84eeb6013c994b577b175ffeede725762c0bead7..fa9965157063f705deaafbe5ce76a538ee44548b 100644 (file)
@@ -151,7 +151,7 @@ void runRevNfa(struct hs_scratch *scratch, const struct internal_report *ri,
     *from_offset = to_offset;
 
     nfaBlockExecReverse(nfa, to_offset, buf, buf_bytes, hbuf, history_bytes,
-                        scratch, somRevCallback, from_offset);
+                        somRevCallback, from_offset);
 
     assert(*from_offset <= to_offset);
 }
index 47fd5d4a74927755f176ce677d717a661a1904fd..679dc67066820c711d32b38d9c6c0c6ed22aa09c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -369,7 +369,7 @@ TEST_P(LimExReverseTest, BlockExecReverse) {
     const size_t hlen = 0;
 
     nfaBlockExecReverse(nfa.get(), offset, buf, buflen, hbuf, hlen,
-                        scratch.get(), onMatch, &matches);
+                        onMatch, &matches);
 
     ASSERT_EQ(3, matches);
 }