wip, thread to start arping

This commit is contained in:
2022-01-31 17:12:32 +01:00
parent a4cd4fd14a
commit ca8a1c046a
14 changed files with 205 additions and 2 deletions

View File

@ -7,6 +7,7 @@
#include "GeneralData.h"
#include "Listener.h"
#include "MasterAttributes.h"
#include "ThreadArping.h"
#include "sls/ToString.h"
#include "sls/ZmqSocket.h" //just for the zmq port define
#include "sls/file_utils.h"
@ -107,6 +108,10 @@ void Implementation::SetupFifoStructure() {
* ************************************************/
void Implementation::setDetectorType(const detectorType d) {
// object to create threads to arping
threadArping = sls::make_unique<ThreadArping>();
detType = d;
switch (detType) {
case GOTTHARD:
@ -323,6 +328,20 @@ std::array<pid_t, NUM_RX_THREAD_IDS> Implementation::getThreadIds() const {
return retval;
}
bool Implementation::getArping() const { return threadArping->IsRunning(); }
void Implementation::setArping(const bool i) {
if (i != threadArping->IsRunning()) {
if (!i) {
threadArping->StopRunning();
} else {
threadArping->ClearIpsAndInterfaces();
threadArping->AddIpsAndInterfaces(eth[0], "10.0.0.1");
threadArping->StartRunning();
}
}
}
/**************************************************
* *
* File Parameters *