X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/53c1823aaef2eb8d547a8eed8cfe12fe7204ca79..daa6cb18a0ff8451a9599905a01d66d6515fdb86:/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp diff --git a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp b/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp index 108c4e0d..24705111 100644 --- a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp +++ b/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp @@ -39,19 +39,20 @@ $Author: faust $ #include #include #include - -#include #include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include + #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 @@ -72,8 +73,6 @@ return bcc.GetPlugin(); //----------------------------------------------------------------------------- int BPF_CAP_SETTINGS::ParseSettings(const MODULE_SETTINGS & s) { -std::string ifaces; - iface.erase(iface.begin(), iface.end()); if (s.moduleParams.empty()) @@ -201,7 +200,11 @@ return 0; //----------------------------------------------------------------------------- void * BPF_CAP::Run(void * d) { -BPF_CAP * dc = (BPF_CAP *)d; +sigset_t signalSet; +sigfillset(&signalSet); +pthread_sigmask(SIG_BLOCK, &signalSet, NULL); + +BPF_CAP * dc = static_cast(d); dc->isRunning = true; uint8_t hdr[96]; //68 + 14 + 4(size) + 9(SYS_IFACE) + 1(align to 4) = 96