00001 //--------------------------------------------------------------------------
00002 // Copyright (C) 2014-2017 Cisco and/or its affiliates. All rights reserved.
00003 //
00004 // This program is free software; you can redistribute it and/or modify it
00005 // under the terms of the GNU General Public License Version 2 as published
00006 // by the Free Software Foundation. You may not use, modify or distribute
00007 // this program under any other version of the GNU General Public License.
00008 //
00009 // This program is distributed in the hope that it will be useful, but
00010 // WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License along
00015 // with this program; if not, write to the Free Software Foundation, Inc.,
00016 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017 //--------------------------------------------------------------------------
00018
00019 // wiz_module.cc author Russ Combs <rucombs@cisco.com>
00020
00021 #ifndef WIZ_MODULE_H
00022 #define WIZ_MODULE_H
00023
00024 // wizard management interface
00025
00026 #include "framework/module.h"
00027
00028 #define WIZ_NAME "wizard"
00029 #define WIZ_HELP "inspector that implements port-independent protocol identification"
00030
00031 extern const PegInfo wiz_pegs[];
00032 extern THREAD_LOCAL struct WizStats tstats;
00033 extern THREAD_LOCAL ProfileStats wizPerfStats;
00034
00035 class MagicBook;
00036 class CurseBook;
00037
00038 class WizardModule : public Module
00039 {
00040 public:
00041 WizardModule();
00042 ~WizardModule() override;
00043
00044 bool set(const char*, Value&, SnortConfig*) override;
00045 bool begin(const char*, int, SnortConfig*) override;
00046 bool end(const char*, int, SnortConfig*) override;
00047
00048 const PegInfo* get_pegs() const override;
00049 PegCount* get_counts() const override;
00050 ProfileStats* get_profile() const override;
00051
00052 MagicBook* get_book(bool c2s, bool hex);
00053 CurseBook* get_curse_book();
00054
00055 Usage get_usage() const override
00056 { return GLOBAL; }
00057
00058 private:
00059 void add_spells(MagicBook*, std::string&);
00060
00061 private:
00062 bool hex;
00063 bool c2s;
00064 std::string service;
00065 std::vector<std::string> spells;
00066
00067 MagicBook* c2s_hexes;
00068 MagicBook* s2c_hexes;
00069
00070 MagicBook* c2s_spells;
00071 MagicBook* s2c_spells;
00072
00073 CurseBook* curses;
00074 };
00075
00076 #endif
00077
END OF CODE