/** * $Id: fp_rfc.h,v 1.13 2002/10/21 08:38:28 plasmahh Exp $ * $Revision: 1.13 $ * $Author: plasmahh $ * $Date: 2002/10/21 08:38:28 $ */ #ifndef __FP_RFC_H #define __FP_RFC_H #ifndef __FP_H #include "fp.h" #endif #define _MAX_RFC 30 /** * @brief RFC Code Message Fingerprint * * This Class will implment the rfc fingerprint version 2. * It will mainly consist of a tree of single "checksum nodes", each one * standing for a different rfc code. In this way, one rfc numeric code may * have arbitrary multiple checksum messages. When creating the error value, it * will only check against the ones with the lowest difference in the tree. I * need to invent something like a minimum/maximum number of checksums for * this, since a fp with much different checksums will then have a bigger error * value than one with only a few... I don't know if this will affect the * accuracy somehow. To the saving. We will always add 1000 to a fingerprint * value. Every value < 1000 will then indicate that the following numbers are * for a new rfc return code. This will hopefully give us some flexibility in * hand-maintaining the fingerprints. */ class fp_rfc : public fp { private: /// Server Version/Identity string unsigned long * run; unsigned long * end; unsigned int maxidx; unsigned int current; void addnew( unsigned int ix, unsigned long cs); public: /** * constructs this fingerprint * @param Version stirng this fingerprint is of */ fp_rfc( const mstring& ver ); virtual ~fp_rfc() { delete[] run; delete[] end; } /** * copy constructor */ fp_rfc( const fp_rfc& ofp ); virtual unsigned long gen_error( fp_rfc& v); /** * adds a return to this fingerprint. The fingerprint will * automatically determine what information will be used * @param string with the return to actual command */ void add( const mstring& ret); /** * adds a value to the fingerprint. Most likely used to build * up a saved fingerprint instead of creating a new one from * server returns. */ void add( unsigned long fp); friend ostream& operator << (ostream &o, fp_rfc & v); }; #else #warning Multiple inclusion of fp_rfc.h check this,shouldnt be possible #endif /** *$Log: fp_rfc.h,v $ *Revision 1.13 2002/10/21 08:38:28 plasmahh *begin cleanup and structure changes for smtpmap 0.8-stable * *Revision 1.12 2002/08/12 13:13:05 plasmahh *removed some memory leaks * *Revision 1.11 2002/06/18 10:52:14 plasmahh *Removed incompatible bzero call for solaris machines * *Revision 1.10 2002/06/11 21:39:31 plasmahh *improved reconnection behaviour * *Revision 1.9 2002/06/11 06:17:31 plasmahh *compiles now even on cygwin ! * *Revision 1.8 2002/06/10 22:10:34 plasmahh *first partly working fingerprinting, moving to BETA state * *Revision 1.7 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.6 2002/05/23 22:37:55 plasmahh *fixed small things in scanner *split fps into .cpp files, because of linker errors in operators * *Revision 1.5 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.4 2002/05/14 16:31:59 plasmahh *implementing new scanner structure, that will be e xtendible * *Revision 1.3 2002/05/06 21:27:44 plasmahh *redesigned the classes a bit... *begin implementing main & static * *Revision 1.2 2002/05/06 11:16:24 plasmahh *some implementation * *Revision 1.1 2002/05/05 20:25:29 plasmahh *Added new fingerprint classes... will delete older soon * */