#include "stg/raw_ip_packet.h"
#include "stg/traffcounter.h"
+#include "stg/plugin_creator.h"
#include "ipq_cap.h"
extern "C"
#include "libipq.h"
}
-class IPQ_CAP_CREATOR {
-private:
- IPQ_CAP * ic;
-
-public:
- IPQ_CAP_CREATOR()
- : ic(new IPQ_CAP())
- {
- }
- ~IPQ_CAP_CREATOR()
- {
- delete ic;
- }
-
- IPQ_CAP * GetCapturer()
- {
- return ic;
- }
-};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-IPQ_CAP_CREATOR icc;
+PLUGIN_CREATOR<IPQ_CAP> icc;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
PLUGIN * GetPlugin()
{
-return icc.GetCapturer();
+return icc.GetPlugin();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
IPQ_CAP::IPQ_CAP()
: ipq_h(NULL),
+ errorStr(),
+ thread(),
nonstop(false),
isRunning(false),
capSock(-1),
- traffCnt(NULL)
+ traffCnt(NULL),
+ buf()
{
memset(buf, 0, BUFSIZE);
}