34 Commits

Author SHA1 Message Date
Lu, Qi
5a0885d235 Windows porting: port hyperscan and chimera tools to windows. 2018-07-09 11:40:43 -04:00
Chang, Harry
8a1c497f44 Logical Combination of patterns. 2018-06-27 14:04:57 +08:00
Alex Coyte
15784954e8 dynamic compression: add HS_CDECL to implementation 2017-08-21 11:24:52 +10:00
Alex Coyte
778addadc5 mangle fdr conf parts of scratch as well 2017-08-21 11:23:54 +10:00
Alex Coyte
d878e8cdf3 add dynamic compression to the public api 2017-08-21 11:19:20 +10:00
Alex Coyte
952f0aad21 support dynamic stream compression 2017-08-21 11:18:54 +10:00
Wang, Xiang W
67a8f43355 literal matchers: change context passed to callback to scratch 2017-08-21 11:12:36 +10:00
Matthew Barr
dba2470ec9 msvc: use the vectorcall calling convention
This requires declaring external interfaces with the cdecl
calling convention.
2017-06-09 10:12:02 +10:00
Alex Coyte
bbd64f98ae allow streams to marked as exhausted in more cases
At stream boundaries, we can mark streams as exhausted if there are no
groups active and there are no other ways to report matches. This allows us
to stop maintaining the history buffer on subsequent stream writes.
Previously, streams were only marked as exhausted if a pure highlander case
reported all patterns or the outfix in a sole outfix case died.
2017-04-26 14:44:53 +10:00
Justin Viiret
a5a6051b8b runtime: init more of scratch in pure-literal exec 2017-03-01 13:05:44 +11:00
Justin Viiret
e271781d95 multibit, fatbit: make _size build-time only
This commit makes mmbit_size() and fatbit_size compile-time only, and
adds a resource limit for very large multibits.
2016-12-14 15:28:54 +11:00
Alex Coyte
71ff480b77 nfa_api: remove subtype from dispatch 2016-12-02 11:32:28 +11:00
Justin Viiret
68bf473e2e fdr: move long literal handling into Rose
Move the hash table used for long literal support in streaming mode from
FDR to Rose, and introduce new instructions CHECK_LONG_LIT and
CHECK_LONG_LIT_NOCASE for doing literal confirm for long literals.

This simplifies FDR confirm, and guarantees that HWLM matchers will only
be used for literals < 256 bytes long.
2016-10-28 14:52:26 +11:00
Matthew Barr
f05e833e10 Only initialise stream state history when required.
This fixes 01org/hyperscan#30.
2016-08-29 11:30:15 +10:00
Anatoly Burakov
6331da4e29 dfa: adding new Sheng engine
A new shuffle-based DFA engine, complete with acceleration and smallwrite.
2016-08-10 15:10:46 +10:00
Justin Viiret
d497a1259a rose: use normal callback for pure-literal cases 2016-08-10 14:52:56 +10:00
Justin Viiret
cf9e40ae1c nfa: unify NfaCallback and SomNfaCallback
Use just one callback type, with both start and end offsets.
2016-07-08 11:01:56 +10:00
Justin Viiret
d5c1280b9f eod: tidy up, rename to roseStreamEodExec 2016-07-08 10:55:36 +10:00
Justin Viiret
c12b953131 runtime: add error for "scratch in use"
This commit adds the HS_SCRATCH_IN_USE error, which is returned when
Hyperscan detects that a scratch region is already in use on entry to an
API function.
2016-05-18 16:27:29 +10:00
Mohammad Abdul Awal
598f0565cf fdr: Remove python codegen, add safezones 2016-05-18 16:22:52 +10:00
Justin Viiret
36150bbc19 Rose: replace internal_report with program
Replace the use of the internal_report structure (for reports from
engines, MPV etc) with the Rose program interpreter.

SOM processing was reworked to use a new som_operation structure that is
embedded in the appropriate instructions.
2016-04-20 13:34:57 +10:00
Justin Viiret
50885f210a exhaust: Update interface
- Only use functions in exhaust.h for valid ekeys
 - Use INVALID_EKEY everywhere (remove dupe END_EXHAUST sentinel)
2016-04-20 13:34:55 +10:00
Justin Viiret
d75cc809fe Runtime: be more careful with status bits 2016-04-20 13:34:55 +10:00
Justin Viiret
93a262e54c Rose: use program for boundary reports
Use the program to handle report lists at boundaries, rather than the
previous list-of-reports approach.
2016-04-20 13:34:54 +10:00
Justin Viiret
67b9784dae Rose: use program for all literal matches
Unifies all literal match paths so that the Rose program is used for all
of them. This removes the previous specialised "direct report" and
"multi direct report" paths. Some additional REPORT instruction work was
necessary for this.

Reworked literal construction path at compile time in prep for using
program offsets as literal IDs.

Completely removed the anchored log runtime, which is no longer worth
the extra complexity.
2016-04-20 13:34:54 +10:00
Justin Viiret
9e9bb6a960 Rose: pack global state bits into one u8
Eliminate the RoseRuntimeState structure in favour of a single status
byte that is stored in scratch and copied to/from stream state.
2016-03-01 11:32:01 +11:00
Justin Viiret
060defe6c4 Rose: move more report handling work into program
Move report preconditions (bounds, exhaustion, etc) into program
instructions and use a more direct path to the user match callback than
the adaptor functions.

Report handling has been moved to new file src/report.h. Reporting from
EOD now uses the same instructions as normal report handling, rather
than its own.

Jump target tracking in rose_build_bytecode.cpp has been cleaned up.
2016-03-01 11:32:01 +11:00
Justin Viiret
4feabf7bd6 Make Rose callback types explicitly take scratch 2016-03-01 11:29:04 +11:00
Justin Viiret
70620327cc Remove RoseContext::userCtx
All Rose callbacks receive scratch as their context.
2016-03-01 11:29:04 +11:00
Justin Viiret
e63fcec3c7 Fix release build (unused var) 2016-03-01 11:24:08 +11:00
Justin Viiret
8783750c72 Remove dupe engine, state ptrs from RoseContext
Remove the RoseEngine and stream state pointers frose RoseContext, as
they are also present in core_info.

Unify stream state handing in Rose to always use a char * (we were often
a u8 * for no particularly good reason) and tidy up.
2016-03-01 11:23:56 +11:00
Justin Viiret
04dfed2602 runtime: hoist broken check in streaming mode 2016-03-01 11:20:22 +11:00
Justin Viiret
9ff1303cd8 Allow no scratch for stream reset API calls
Bring hs_reset_stream(), hs_reset_and_copy_stream()'s functionality into
line with hs_close_stream() by accepting a NULL scratch if and only if
the match callback is also NULL, indicating that no matches should be
delivered.
2015-10-30 11:28:37 +11:00
Matthew Barr
904e436f11 Initial commit of Hyperscan 2015-10-20 09:13:35 +11:00