/src/suricata7/src/runmode-windivert.c
Line | Count | Source |
1 | | /* Copyright (C) 2018 Open Information Security Foundation |
2 | | * |
3 | | * You can copy, redistribute or modify this Program under the terms of |
4 | | * the GNU General Public License version 2 as published by the Free |
5 | | * Software Foundation. |
6 | | * |
7 | | * This program is distributed in the hope that it will be useful, |
8 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 | | * GNU General Public License for more details. |
11 | | * |
12 | | * You should have received a copy of the GNU General Public License |
13 | | * version 2 along with this program; if not, write to the Free Software |
14 | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
15 | | * 02110-1301, USA. |
16 | | */ |
17 | | |
18 | | /** |
19 | | * \file |
20 | | * |
21 | | * \author Jacob Masen-Smith <jacob@evengx.com> |
22 | | * |
23 | | * Handling of WinDivert runmodes. |
24 | | */ |
25 | | |
26 | | #include "suricata-common.h" |
27 | | #include "tm-threads.h" |
28 | | #include "conf.h" |
29 | | #include "runmodes.h" |
30 | | #include "runmode-windivert.h" |
31 | | #include "output.h" |
32 | | |
33 | | #include "util-affinity.h" |
34 | | #include "util-cpu.h" |
35 | | #include "util-debug.h" |
36 | | #include "util-device.h" |
37 | | #include "util-runmodes.h" |
38 | | #include "util-time.h" |
39 | | |
40 | | const char *RunModeIpsWinDivertGetDefaultMode(void) |
41 | 0 | { |
42 | 0 | return "autofp"; |
43 | 0 | } |
44 | | |
45 | | void RunModeIpsWinDivertRegister(void) |
46 | 80 | { |
47 | 80 | RunModeRegisterNewRunMode(RUNMODE_WINDIVERT, "autofp", |
48 | 80 | "Multi-threaded WinDivert IPS mode load-balanced by flow", RunModeIpsWinDivertAutoFp, |
49 | 80 | NULL); |
50 | 80 | } |
51 | | |
52 | | int RunModeIpsWinDivertAutoFp(void) |
53 | 0 | { |
54 | 0 | SCEnter(); |
55 | 0 | int ret = 0; |
56 | | #ifdef WINDIVERT |
57 | | TimeModeSetLive(); |
58 | | |
59 | | LiveDeviceHasNoStats(); |
60 | | |
61 | | ret = RunModeSetIPSAutoFp(WinDivertGetThread, "ReceiveWinDivert", |
62 | | "VerdictWinDivert", "DecodeWinDivert"); |
63 | | #endif /* WINDIVERT */ |
64 | 0 | return ret; |
65 | 0 | } |