#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];
pollfd pollddiv;
DIVERT_DATA cddiv; //capture data
//-----------------------------------------------------------------------------
-class DIVERT_CAP_CREATOR
-{
+class DIVERT_CAP_CREATOR {
private:
DIVERT_CAP * divc;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-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)
traffCnt = tc;
}
//-----------------------------------------------------------------------------
-const string & DIVERT_CAP::GetStrError() const
+const std::string & DIVERT_CAP::GetStrError() const
{
return errorStr;
}
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))
{