]> git.stg.codes - stg.git/blobdiff - stargazer/plugins/capture/divert_freebsd/divert_cap.cpp
Merge pull request #1 from yuriio147/mysql-store-db-port
[stg.git] / stargazer / plugins / capture / divert_freebsd / divert_cap.cpp
index 6019fa4b6dc6d45f46bb4fb2021d1844ee4fac44..289846869a4bb2d4b8e2116e548ff08a065120f7 100644 (file)
@@ -25,8 +25,9 @@ $Date: 2010/09/10 06:43:03 $
 
 #include "divert_cap.h"
 
-#include "stg/common.h"
 #include "stg/traffcounter.h"
+#include "stg/raw_ip_packet.h"
+#include "stg/common.h"
 
 #include <algorithm>
 #include <vector>
@@ -156,7 +157,7 @@ pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
 DIVERT_CAP * dc = static_cast<DIVERT_CAP *>(d);
 dc->isRunning = true;
 
-char buffer[pcktSize + 14];
+char buffer[STG::packetSize + 14];
 while (dc->nonstop)
     {
     STG::RawPacket rp;
@@ -165,7 +166,7 @@ while (dc->nonstop)
     if (buffer[12] != 0x8)
         continue;
 
-    memcpy(rp.rawPacket.pckt, &buffer[14], pcktSize);
+    memcpy(&rp.rawPacket, &buffer[14], STG::packetSize);
 
     dc->traffCnt->process(rp);
     }