"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/service_inspectors/wizard/magic.h" between
snort3-3.1.28.0.tar.gz and snort3-3.1.29.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

magic.h  (snort3-3.1.28.0):magic.h  (snort3-3.1.29.0)
skipping to change at line 55 skipping to change at line 55
class MagicBook class MagicBook
{ {
public: public:
virtual ~MagicBook(); virtual ~MagicBook();
MagicBook(const MagicBook&) = delete; MagicBook(const MagicBook&) = delete;
MagicBook& operator=(const MagicBook&) = delete; MagicBook& operator=(const MagicBook&) = delete;
virtual bool add_spell(const char* key, const char*& val) = 0; virtual bool add_spell(const char* key, const char*& val) = 0;
virtual const char* find_spell(const uint8_t* data, unsigned len, const Magi virtual const char* find_spell(const uint8_t* data, unsigned len, const Magi
cPage*&) const; cPage*& p,
const MagicPage*& bookmark) const;
const MagicPage* page1() const const MagicPage* page1() const
{ return root; } { return root; }
virtual void set_bookmark(const MagicPage* page = nullptr) const
{ (void)page; }
virtual const MagicPage* get_bookmark() const
{ return nullptr; }
protected: protected:
MagicBook(); MagicBook();
MagicPage* root; MagicPage* root;
virtual const MagicPage* find_spell(const uint8_t*, unsigned, virtual const MagicPage* find_spell(const uint8_t*, unsigned,
const MagicPage*, unsigned) const = 0; const MagicPage*, unsigned, const MagicPage*&) const = 0;
}; };
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// spells - a sequence of case insensitive text strings with wild cards // spells - a sequence of case insensitive text strings with wild cards
// designated by * (indicating any number of arbitrary bytes) // designated by * (indicating any number of arbitrary bytes)
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
class SpellBook : public MagicBook class SpellBook : public MagicBook
{ {
public: public:
SpellBook(); SpellBook();
bool add_spell(const char*, const char*&) override; bool add_spell(const char*, const char*&) override;
void set_bookmark(const MagicPage* page = nullptr) const override
{ glob = page; }
const MagicPage* get_bookmark() const override
{ return glob; }
private: private:
bool translate(const char*, HexVector&); bool translate(const char*, HexVector&);
void add_spell(const char*, const char*, HexVector&, unsigned, MagicPage*); void add_spell(const char*, const char*, HexVector&, unsigned, MagicPage*);
const MagicPage* find_spell(const uint8_t*, unsigned, const MagicPage*, unsi const MagicPage* find_spell(const uint8_t*, unsigned, const MagicPage*, unsi
gned) const override; gned,
const MagicPage*&) const override;
mutable const MagicPage* glob;
}; };
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// hexes - a sequence of pipe delimited hex, text literals, and wild chars // hexes - a sequence of pipe delimited hex, text literals, and wild chars
// designated by '?' (indicating one arbitrary byte) // designated by '?' (indicating one arbitrary byte)
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
class HexBook : public MagicBook class HexBook : public MagicBook
{ {
public: public:
HexBook() = default; HexBook() = default;
bool add_spell(const char*, const char*&) override; bool add_spell(const char*, const char*&) override;
private: private:
bool translate(const char*, HexVector&); bool translate(const char*, HexVector&);
void add_spell(const char*, const char*, HexVector&, unsigned, MagicPage*); void add_spell(const char*, const char*, HexVector&, unsigned, MagicPage*);
const MagicPage* find_spell(const uint8_t*, unsigned, const MagicPage*, unsi const MagicPage* find_spell(const uint8_t*, unsigned, const MagicPage*, unsi
gned) const override; gned,
const MagicPage*&) const override;
}; };
#endif #endif
 End of changes. 6 change blocks. 
20 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)