/* * Paglo Crawler * Copyright (C) 2006-2008 Paglo Labs Inc. All rights reserved. * www.paglo.com * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ //--------------------------------------------------------------------------- #ifndef RubyThreadH #define RubyThreadH //--------------------------------------------------------------------------- #include "Thread.h" #include "EventQueue.h" /* * Scan a switch or router reading out available address information. */ class TRubyThread : public TPThread { public: TRubyThread(); virtual ~TRubyThread(); virtual void Run(); /* * Whether the thread is actually busy running a plugin. */ bool Active; /* * Name of the currently executing plugin. */ string CurrentPluginName; /* * Time the plugin started executing. */ time_t PluginStartTime; TEventQueue *GetInputQueue() { return InputQueue; } bool GetPlugins(void); protected: bool InitInterpreter(const char *Path); void PluginManagerPoll(); TEventQueue *InputQueue; }; //--------------------------------------------------------------------------- class TScanPlugin : public TScanRequest { public: TScanPlugin(TIPAddress &TargetIP) { this->TargetIP = TargetIP; } virtual string TypeString(void) { return "SCAN_PLUGINS"; } virtual string Description(void) { return "Plugins against " + TargetIP.Print(); } virtual TScanType GetType(void) { return SCAN_PLUGINS; } virtual TScanResult *PerformScan(TPThread *Thread); }; //--------------------------------------------------------------------------- class TInstallPlugin : public TScanRequest { public: TInstallPlugin(std::string Path, bool FromURL) { this->Path = Path; this->FromURL = FromURL; } virtual string TypeString(void) { return "INSTALL_PLUGIN"; } virtual string Description(void) { return "Installing plugin " + Path; } virtual TScanType GetType(void) { return INSTALL_PLUGIN; } virtual TScanResult *PerformScan(TPThread *Thread); protected: std::string Path; bool FromURL; }; //--------------------------------------------------------------------------- #endif