X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/ede91934442fd804d7b818971a44e3ad795cb01f..22d2f0c2d5260b86a857f08f80ff490614c55066:/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp?ds=inline diff --git a/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp b/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp index ddbe935a..23d6413c 100644 --- a/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp +++ b/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp @@ -37,26 +37,26 @@ $Author: faust $ #include #include -#include "common.h" -#include "cap_nf.h" -#include "raw_ip_packet.h" +#include -#include "../../../traffcounter.h" +#include "stg/common.h" +#include "stg/raw_ip_packet.h" +#include "stg/traffcounter.h" +#include "cap_nf.h" -class CAP_NF_CREATOR -{ +class CAP_NF_CREATOR { public: CAP_NF_CREATOR() : nf(new NF_CAP()) { - }; + } ~CAP_NF_CREATOR() { delete nf; - }; + } - NF_CAP * GetCapturer() { return nf; }; + NF_CAP * GetCapturer() { return nf; } private: NF_CAP * nf; } cnc; @@ -87,7 +87,7 @@ NF_CAP::~NF_CAP() int NF_CAP::ParseSettings() { -vector::iterator it; +std::vector::iterator it; for (it = settings.moduleParams.begin(); it != settings.moduleParams.end(); ++it) { if (it->param == "TCPPort") @@ -278,9 +278,6 @@ while (cap->runningUDP) continue; } - - // Wrong logic! - // Need to check actual data length and wait all data to receive if (res < 24) { if (errno != EINTR) @@ -390,14 +387,6 @@ for (int i = 0; i < packets; ++i) { NF_DATA * data = reinterpret_cast(buf + 24 + i * 48); - /*ip.pckt[0] = 4 << 4; - ip.pckt[0] |= 5; - ip.pckt[9] = data->proto; - ip.dataLen = ntohl(data->octets); - *(uint32_t *)(ip.pckt + 12) = data->srcAddr; - *(uint32_t *)(ip.pckt + 16) = data->dstAddr; - *(uint16_t *)(ip.pckt + 20) = data->srcPort; - *(uint16_t *)(ip.pckt + 22) = data->dstPort;*/ ip.header.ipHeader.ip_v = 4; ip.header.ipHeader.ip_hl = 5; ip.header.ipHeader.ip_p = data->proto;