Port Hyperscan to support DPI/IDS/IPS
[vpp.git] / src / plugins / hyperscan / hyperscan_plugin_doc.md
1 # Hyperscan plugin for VPP    {#hyperscan_plugin_doc}
2
3 ## Overview
4
5 Hyperscan is a high-performance multiple regex matching library.
6 Please refer to below for details:
7 http://intel.github.io/hyperscan/dev-reference/
8
9 This plugin provides Hyperscan support on VPP, so can implement DPI/IPS/IDS etc.
10
11 ## Hyperscan Installation on Ubuntu
12 1).Install binary prerequisites
13 apt-get install cmake ragel
14 apt-get install libboost-dev
15 apt-get install python-dev libbz2-dev
16
17 2).Download Hyperscan sources
18 wget https://github.com/intel/hyperscan/archive/v4.7.0.tar.gz
19 tar -xf v4.7.0.tar.gz
20
21 3).Download boost headers
22 wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
23 tar -xf boost_1_67_0.tar.gz
24 cp -r boost_1_67_0/boost hyperscan-4.7.0/include
25
26 4).Build and install Hyperscan shared library.
27    Just follow the instruction from here. Compilation can take a long time.
28 cd hyperscan-4.7.0
29 mkdir build
30 cd build
31 cmake -DBUILD_SHARED_LIBS=true ..
32 make
33 make install
34
35
36 ## Configuration
37
38 ### Configure ip_hyperscan_bypass
39
40 The hyperscan plugin need to redirct packets to hyperscan-scan graph node:
41
42         hs set interface ip4 hyperscan-bypass <interface> [del]
43
44 interface: the interface that you want to enable hyperscan.
45
46
47 ### Configure and compile Hyperscan
48
49 The hyperscan plugin need to configure regular matching patterns
50 and compile them into database.
51
52     hs compile mode [block|stream] flags [imsHV8W\r] \
53                patterns <patterns>
54
55 mode: Compiler mode.
56       HS_MODE_BLOCK or HS_MODE_STREAM or HS_MODE_VECTORED must be supplied.
57 flags: Flags which modify the behaviour of the expression.
58        Multiple flags may be used by ORing them together.
59 patterns: The NULL-terminated expression to parse
60