#include <signal.h>
#include <unistd.h>
+#include "stg/common.h"
+#include "stg/raw_ip_packet.h"
+#include "stg/traffcounter.h"
+#include "stg/plugin_creator.h"
#include "ether_cap.h"
-#include "common.h"
-#include "raw_ip_packet.h"
-#include "traffcounter.h"
//#define CAP_DEBUG 1
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-class BPF_CAP_CREATOR {
-private:
- BPF_CAP * bpfc;
-
-public:
- BPF_CAP_CREATOR()
- : bpfc(new BPF_CAP())
- {
- }
- ~BPF_CAP_CREATOR()
- {
- delete bpfc;
- }
- BPF_CAP * GetCapturer()
- {
- return bpfc;
- }
-};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-BPF_CAP_CREATOR bcc;
+PLUGIN_CREATOR<BPF_CAP> bcc;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
PLUGIN * GetPlugin()
{
-return bcc.GetCapturer();
+return bcc.GetPlugin();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------