/** * $Id: fp.h,v 1.10 2002/10/21 08:38:28 plasmahh Exp $ * $Revision: 1.10 $ * $Author: plasmahh $ * $Date: 2002/10/21 08:38:28 $ */ #ifndef __FP_H #define __FP_H #ifndef __DLLIST_H #include "dllist.h" #endif /** * @brief Base Class for fingerprints * * This class is a pure virtual class, and defines * the interface to all fingerprints. see the single functions for * more details. The actual data and functunalty will be in the * derived classes */ enum fp_type { FP_Base = 0, FP_Conf = 1, FP_Return = 2, FP_Rfc = 4, FP_Pop3 = 8, FP_Imap = 16, FP_Ftp = 32 }; class fp { protected: /// Server Version/Identity string mstring version; /// error value for other fps... uint32 error; /// The type of this fingerprint fp_type my_type; public: fp(const mstring& ver,fp_type f) :version(ver), error(0), my_type(f) {} virtual ~fp(){}; /// Returns the error value as absolute inline uint32 Error( void ) { return error; } /// returns the version string of this fingerprint inline mstring Version ( void ) const { return version; } /// returns the type of this fingerprints... inline fp_type Type( void ) const; /// builds up the fp with predefined values virtual void add ( uint32 fp) { } /// adds a answer string to the fp (derived takes care how) virtual void add ( const mstring& ret ) { } friend ostream& operator << ( ostream & o, const fp&); friend bool operator < ( const fp&, const fp&); friend bool operator > ( const fp&, const fp&); // mh, how can I force one to generate errors ??? the data is stored in the // upper classes, so I cant give a base object... hm.... virtual void // gen_error( ???? ); }; #else #warning Multiple inclusion of fp.h check, shouldnt be possible #endif /** *$Log: fp.h,v $ *Revision 1.10 2002/10/21 08:38:28 plasmahh *begin cleanup and structure changes for smtpmap 0.8-stable * *Revision 1.9 2002/10/16 23:06:17 plasmahh *new function for reading fingerprints from file *fixes some stuff * *Revision 1.8 2002/06/20 20:59:36 plasmahh *internal documentation changes * *Revision 1.7 2002/06/11 14:16:11 plasmahh *Added << operator * *Revision 1.6 2002/06/10 22:10:34 plasmahh *first partly working fingerprinting, moving to BETA state * *Revision 1.5 2002/06/09 21:22:39 plasmahh *lots of changes *some slight fingerprint changes, also in constructor *scanner changes and fixes in constructor *read fixes *test programs fixes, no more segfaults *new TODO * *Revision 1.4 2002/05/27 06:26:16 plasmahh *Implemented, tested and fixed fingerprinting. Test Programs generate good fingerprints, only need to put all in a program and generateerror values * *Revision 1.3 2002/05/23 19:50:04 plasmahh *refined include structure. *implemented and fixed some parts, still not working *BUG !! FIX THIS !!! : multiple definition of some operators, we will never compile !! * *Revision 1.2 2002/05/13 13:56:46 plasmahh **** empty log message *** * *Revision 1.1 2002/05/07 12:55:44 plasmahh *Introduced base class for all fingerprints * */