1 //--------------------------------------------------------------------------
2 // Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
3 //
4 // This program is free software; you can redistribute it and/or modify it
5 // under the terms of the GNU General Public License Version 2 as published
6 // by the Free Software Foundation.  You may not use, modify or distribute
7 // this program under any other version of the GNU General Public License.
8 //
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License along
15 // with this program; if not, write to the Free Software Foundation, Inc.,
16 // 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 //--------------------------------------------------------------------------
18 // user_module.h author Russ Combs <rucombs@cisco.com>
19 
20 #ifndef USER_MODULE_H
21 #define USER_MODULE_H
22 
23 #include "framework/module.h"
24 
25 namespace snort
26 {
27 class Trace;
28 struct SnortConfig;
29 }
30 
31 extern THREAD_LOCAL const snort::Trace* stream_user_trace;
32 extern THREAD_LOCAL snort::ProfileStats user_perf_stats;
33 
34 //-------------------------------------------------------------------------
35 // stream_user module
36 //-------------------------------------------------------------------------
37 
38 #define MOD_NAME "stream_user"
39 #define MOD_HELP "stream inspector for user flow tracking and reassembly "
40 
41 struct StreamUserConfig;
42 
43 class StreamUserModule : public snort::Module
44 {
45 public:
46     StreamUserModule();
47     ~StreamUserModule() override;
48 
49     bool set(const char*, snort::Value&, snort::SnortConfig*) override;
50     bool begin(const char*, int, snort::SnortConfig*) override;
51 
get_usage()52     Usage get_usage() const override
53     { return INSPECT; }
54 
is_bindable()55     bool is_bindable() const override
56     { return true; }
57 
58     StreamUserConfig* get_data();
59 
60     void set_trace(const snort::Trace*) const override;
61     const snort::TraceOption* get_trace_options() const override;
62 
63 private:
64     StreamUserConfig* config;
65 };
66 
67 #endif
68 
69