X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..7b080a40a5b9d39c8af0a61371b433ee61cb52ff:/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp?ds=inline diff --git a/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp b/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp index 799e399d..595c45fc 100644 --- a/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp +++ b/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp @@ -37,9 +37,10 @@ $Author: faust $ #include #include -#include "debug_cap.h" -#include "../../../traffcounter.h" #include "libpal.h" +#include "stg/plugin_creator.h" +#include "stg/traffcounter.h" +#include "debug_cap.h" //----------------------------------------------------------------------------- void WriteStat(uint32_t u, uint32_t d) @@ -53,46 +54,26 @@ fprintf(f, "up %5.2f Mbit, down %5.2f Mbit, sum %5.2f Mbit\n", fclose(f); } //----------------------------------------------------------------------------- - -class CAP_DEBUG_CREATOR -{ -private: - DEBUG_CAP * dc; - -public: - CAP_DEBUG_CREATOR() - : dc(new DEBUG_CAP()) - { - }; - ~CAP_DEBUG_CREATOR() - { - delete dc; - }; - - DEBUG_CAP * GetCapturer() - { - return dc; - }; -}; -//----------------------------------------------------------------------------- -RAW_PACKET MakeTCPPacket(const char * src, - const char * dst, - uint16_t sport, - uint16_t dport, - uint16_t len); //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -CAP_DEBUG_CREATOR cdc; +PLUGIN_CREATOR cdc; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- BASE_PLUGIN * GetPlugin() { -return cdc.GetCapturer(); +return cdc.GetPlugin(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +RAW_PACKET MakeTCPPacket(const char * src, + const char * dst, + uint16_t sport, + uint16_t dport, + uint16_t len); const string DEBUG_CAP::GetVersion() const { return "Debug_cap v.0.01a";