#include "scanner_server.h" #ifndef __DLLIST_H #include "dllist.h" #endif #ifndef __MSTRING_H #include "mstring.h" #endif #ifndef __MFILE_H #include "mfile.h" #endif #ifndef __FP_CONF_H #include "fp_conf.h" #endif #ifndef __FP_RFC_H #include "fp_rfc.h" #endif #ifndef __FP_RETURN_H #include "fp_return.h" #endif #include "smtp_commands.h" class scanner_smtp : public scanner_server { private: /// This holds our list of read config fingerprints from file dllist conffp; /// This holds our list of read rfc fingerprints from file dllist rfcfp; /// This holds the list of return fingerprints from file dllist returnfp; /// This is the pointer to the conf fingerprints from the last scan fp_conf * scanned_conf; /// This is the pointer to the rfc fingerprints from the last scan fp_rfc * scanned_rfc; /// This is the pointer to the return fingerprints from the last scan fp_return * scanned_return; /// Generic fingerprint loader (Will move to base class later ???) BOOL load_fp (const mstring& file, const mstring& identifier, fp_type fpt); /// This function will load the conf fingerprints from a predefined file BOOL load_conf_fps( void ); /// This function will load the return fingerprints from a predefined file BOOL load_return_fps( void ); /// This function will load the rfc fingerprints from a predefined file BOOL load_rfc_fps( void ); /// genereate a list from comma sperated values here, returns -1 in case of eerror sint32 gen_fp_data (fp * cfp, mstring & fp); /// checks if the actual fingerprint length is ok uint32 check_lenge(uint32, uint32, uint32, BOOL); void printerror(const mstring &, uint32); /// This is a dummy function to avoid warning by compiler for unused struct testcmds inline void dummy ( void ) { const char ** dumm = testcmds; dumm++;} protected: public: virtual ~scanner_smtp(); /// We need a socket, the debuglevel, if beeing polite, connect & receive timeout scanner_smtp(small_socket& sk, int debug, bool pol, long ct, long rt) : scanner_server(sk,debug, pol,ct, rt), scanned_conf(NULL), scanned_rfc(NULL), scanned_return(NULL){ }; /// returns the protocol we are scanning inline virtual mstring protocol( void ) { return "SMTP"; } /// does everything for initialization, returns false in case of error virtual bool initialize( void ); /// lookst if the server connected to is really a sserver of searched type virtual mstring is_server( void ); /// finalize a scan (generate error values) virtual void finalize( void ); /// returns all the fingerprints that will then be displayed virtual dllist < dllist < fp > > get_fps( void ); /// returns the descriptions belonging to the fingerprints virtual dllist< mstring > get_descs( void ); /// Does the real scan virtual bool do_scan( void ); };