X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..321b5c0630ef3b27469a008be31c9fcc131c2c8d:/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp b/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp index 9fc946ca..fbf35894 100644 --- a/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp +++ b/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp @@ -7,12 +7,11 @@ #include "raw_ip_packet.h" extern "C" - { - #include "libipq.h" - } - -class IPQ_CAP_CREATOR { +#include "libipq.h" +} + +class IPQ_CAP_CREATOR { private: IPQ_CAP * ic; @@ -38,22 +37,26 @@ IPQ_CAP_CREATOR icc; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -BASE_PLUGIN * GetPlugin() +PLUGIN * GetPlugin() { return icc.GetCapturer(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -const string IPQ_CAP::GetVersion() const +const std::string IPQ_CAP::GetVersion() const { return "ipq_cap v.1.2"; } //----------------------------------------------------------------------------- IPQ_CAP::IPQ_CAP() + : ipq_h(NULL), + nonstop(false), + isRunning(false), + capSock(-1), + traffCnt(NULL) { -isRunning = false; -nonstop = false; +memset(buf, 0, BUFSIZE); } //----------------------------------------------------------------------------- void IPQ_CAP::SetTraffcounter(TRAFFCOUNTER * tc) @@ -61,7 +64,7 @@ void IPQ_CAP::SetTraffcounter(TRAFFCOUNTER * tc) traffCnt = tc; } //----------------------------------------------------------------------------- -const string & IPQ_CAP::GetStrError() const +const std::string & IPQ_CAP::GetStrError() const { return errorStr; }