$Date: 2009/12/13 13:45:13 $
*/
+#include "ether_cap.h"
+
+#include "stg/common.h"
+#include "stg/raw_ip_packet.h"
+#include "stg/traffcounter.h"
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <csignal>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <net/if.h>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <cerrno>
-#include <csignal>
-
-#include "stg/common.h"
-#include "stg/raw_ip_packet.h"
-#include "stg/traffcounter.h"
-#include "stg/plugin_creator.h"
-
-#include "ether_cap.h"
-
//#define CAP_DEBUG 1
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-namespace
-{
-PLUGIN_CREATOR<ETHER_CAP> ecc;
-}
-
-extern "C" PLUGIN * GetPlugin();
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-PLUGIN * GetPlugin()
+extern "C" STG::Plugin* GetPlugin()
{
-return ecc.GetPlugin();
+ static ETHER_CAP plugin;
+ return &plugin;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
isRunning(false),
capSock(-1),
traffCnt(NULL),
- logger(GetPluginLogger(GetStgLogger(), "cap_ether"))
+ logger(STG::PluginLogger::get("cap_ether"))
{
}
//-----------------------------------------------------------------------------
struct ETH_IP
{
uint16_t ethHdr[8];
-RAW_PACKET rp;
+STG::RawPacket rp;
char padding[4];
char padding1[8];
};
if (ethIP->ethHdr[7] != 0x8)
continue;
- dc->traffCnt->Process(ethIP->rp);
+ dc->traffCnt->process(ethIP->rp);
}
dc->isRunning = false;