X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..321b5c0630ef3b27469a008be31c9fcc131c2c8d:/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp index a76629fb..2bc83cad 100644 --- a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp +++ b/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp @@ -45,8 +45,7 @@ $Date: 2010/09/10 06:43:03 $ #define BUFF_LEN (16384) /* max mtu -> lo=16436 TODO why?*/ //----------------------------------------------------------------------------- -struct DIVERT_DATA -{ +struct DIVERT_DATA { int sock; short int port; unsigned char buffer[BUFF_LEN]; @@ -56,8 +55,7 @@ char iface[10]; pollfd pollddiv; DIVERT_DATA cddiv; //capture data //----------------------------------------------------------------------------- -class DIVERT_CAP_CREATOR -{ +class DIVERT_CAP_CREATOR { private: DIVERT_CAP * divc; @@ -83,22 +81,24 @@ DIVERT_CAP_CREATOR dcc; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -BASE_PLUGIN * GetPlugin() +PLUGIN * GetPlugin() { return dcc.GetCapturer(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -const string DIVERT_CAP::GetVersion() const +const std::string DIVERT_CAP::GetVersion() const { return "Divert_cap v.1.0"; } //----------------------------------------------------------------------------- DIVERT_CAP::DIVERT_CAP() + : port(0), + nonstop(false), + isRunning(false), + traffCnt(NULL) { -isRunning = false; -nonstop = false; } //----------------------------------------------------------------------------- void DIVERT_CAP::SetTraffcounter(TRAFFCOUNTER * tc) @@ -106,7 +106,7 @@ void DIVERT_CAP::SetTraffcounter(TRAFFCOUNTER * tc) traffCnt = tc; } //----------------------------------------------------------------------------- -const string & DIVERT_CAP::GetStrError() const +const std::string & DIVERT_CAP::GetStrError() const { return errorStr; } @@ -350,7 +350,7 @@ port = p; return 0; } //----------------------------------------------------------------------------- -int DIVERT_CAP::ParseIntInRange(const string & str, int min, int max, int * val) +int DIVERT_CAP::ParseIntInRange(const std::string & str, int min, int max, int * val) { if (str2x(str.c_str(), *val)) {