#include "pcap_cap.h"
#include "stg/traffcounter.h"
-#include "stg/plugin_creator.h"
#include "stg/common.h"
#include "stg/raw_ip_packet.h"
//-----------------------------------------------------------------------------
namespace
{
-PLUGIN_CREATOR<PCAP_CAP> pcc;
const size_t SNAP_LEN = 1518;
const size_t ETHER_ADDR_LEN = 6;
}
-extern "C" PLUGIN * GetPlugin();
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-PLUGIN * GetPlugin()
+extern "C" STG::Plugin* GetPlugin()
{
-return pcc.GetPlugin();
+ static PCAP_CAP plugin;
+ return &plugin;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
: nonstop(false),
isRunning(false),
traffCnt(NULL),
- logger(GetPluginLogger(GetStgLogger(), "pcap_cap"))
+ logger(STG::PluginLogger::get("pcap_cap"))
{
}
//-----------------------------------------------------------------------------
if (eth->ether_type != 0x8)
return;
-RAW_PACKET ip;
+STG::RawPacket ip;
memcpy(&ip.rawPacket, packet + 14, sizeof(ip.rawPacket));
-traffCnt->Process(ip);
+traffCnt->process(ip);
}