#include <signal.h>
#include <unistd.h>
-#include <string>
-#include <vector>
-
#include "ether_cap.h"
#include "common.h"
#include "raw_ip_packet.h"
-using namespace std;
-
//#define CAP_DEBUG 1
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-class BPF_CAP_CREATOR
-{
+class BPF_CAP_CREATOR {
private:
BPF_CAP * bpfc;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-BASE_PLUGIN * GetPlugin()
+PLUGIN * GetPlugin()
{
return bcc.GetCapturer();
}
{
//char sep[]= ", \t\n\r";
//char *s;
-string ifaces;
+std::string ifaces;
//char * str;
//char *p;
return 0;
}
//-----------------------------------------------------------------------------
-string BPF_CAP_SETTINGS::GetIface(unsigned int num)
+std::string BPF_CAP_SETTINGS::GetIface(unsigned int num)
{
if (num >= iface.size())
{
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-const string BPF_CAP::GetVersion() const
+const std::string BPF_CAP::GetVersion() const
{
return "bpf_cap v.1.0";
}
traffCnt = tc;
}
//-----------------------------------------------------------------------------
-const string & BPF_CAP::GetStrError() const
+const std::string & BPF_CAP::GetStrError() const
{
return errorStr;
}
//if (ioctl(cd[n].fd, BIOCSBLEN, (caddr_t)&l) < 0)
if (ioctl(bd->fd, BIOCSBLEN, (caddr_t)&l) < 0)
{
- errorStr = bd->iface + " BIOCSBLEN " + string(strerror(errno));
+ errorStr = bd->iface + " BIOCSBLEN " + std::string(strerror(errno));
printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str());
return -1;
}
//if (ioctl(cd[n].fd, BIOCSETIF, (caddr_t)&ifr) < 0 )
if (ioctl(bd->fd, BIOCSETIF, (caddr_t)&ifr) < 0)
{
- errorStr = bd->iface + " BIOCSETIF " + string(strerror(errno));
+ errorStr = bd->iface + " BIOCSETIF " + std::string(strerror(errno));
printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str());
return -1;
}
//if (ioctl(cd[n].fd, BIOCIMMEDIATE, &im) < 0 )
if (ioctl(bd->fd, BIOCIMMEDIATE, &im) < 0)
{
- errorStr = bd->iface + " BIOCIMMEDIATE " + string(strerror(errno));
+ errorStr = bd->iface + " BIOCIMMEDIATE " + std::string(strerror(errno));
printfd(__FILE__, "ioctl failed: '%s'\n", errorStr.c_str());
return -1;
}