binaries in after merge

This commit is contained in:
2021-09-09 10:46:59 +02:00
31 changed files with 168 additions and 179 deletions

View File

@ -1379,15 +1379,8 @@ IpAddr CmdProxy::getIpFromAuto() {
return val;
}
defs::udpDestination CmdProxy::getUdpList() {
uint32_t entry{};
uint32_t port{};
uint32_t port2{};
uint32_t ip{};
uint32_t ip2{};
uint64_t mac{};
uint64_t mac2{};
UdpDestination CmdProxy::getUdpEntry() {
UdpDestination udpDestination{};
bool hasEntry = false;
for (auto it : args) {
@ -1395,40 +1388,40 @@ defs::udpDestination CmdProxy::getUdpList() {
std::string key = it.substr(0, pos);
std::string value = it.substr(pos + 1);
if (key == "entry") {
entry = StringTo<int>(value);
udpDestination.entry = StringTo<int>(value);
hasEntry = true;
} else if (key == "ip") {
if (value == "auto") {
auto val = getIpFromAuto();
LOG(logINFO) << "Setting udp_dstip of detector " << det_id
<< " to " << val;
ip = val.uint32();
udpDestination.ip = val;
} else {
ip = IpAddr(value).uint32();
udpDestination.ip = IpAddr(value);
}
} else if (key == "ip2") {
if (value == "auto") {
auto val = getIpFromAuto();
LOG(logINFO) << "Setting udp_dstip2 of detector " << det_id
<< " to " << val;
ip2 = val.uint32();
udpDestination.ip2 = val;
} else {
ip2 = IpAddr(value).uint32();
udpDestination.ip2 = IpAddr(value);
}
} else if (key == "mac") {
mac = MacAddr(value).uint64();
udpDestination.mac = MacAddr(value);
} else if (key == "mac2") {
mac2 = MacAddr(value).uint64();
udpDestination.mac2 = MacAddr(value);
} else if (key == "port") {
port = StringTo<uint32_t>(value);
udpDestination.port = StringTo<uint32_t>(value);
} else if (key == "port2") {
port2 = StringTo<uint32_t>(value);
udpDestination.port2 = StringTo<uint32_t>(value);
}
}
if (!hasEntry) {
throw sls::RuntimeError("Found no entry argument.");
}
return defs::udpDestination(entry, port, ip, mac, port2, ip2, mac2);
return udpDestination;
}
std::string CmdProxy::UDPDestinationList(int action) {
@ -1454,7 +1447,7 @@ std::string CmdProxy::UDPDestinationList(int action) {
if (args.empty()) {
WrongNumberOfParameters(1);
}
auto t = getUdpList();
auto t = getUdpEntry();
det->setDestinationUDPList(t, det_id);
os << ToString(args) << std::endl;
} else {

View File

@ -1117,7 +1117,7 @@ class CmdProxy {
std::string Trigger(int action);
/* Network Configuration (Detector<->Receiver) */
IpAddr getIpFromAuto();
slsDetectorDefs::udpDestination getUdpList();
UdpDestination getUdpEntry();
std::string UDPDestinationList(int action);
std::string UDPDestinationIP(int action);
std::string UDPDestinationIP2(int action);

View File

@ -908,12 +908,12 @@ void Detector::setSourceUDPMAC2(const MacAddr mac, Positions pos) {
pimpl->Parallel(&Module::setSourceUDPMAC2, pos, mac);
}
Result<defs::udpDestination>
Detector::getDestinationUDPList(const uint32_t entry, Positions pos) const {
Result<UdpDestination> Detector::getDestinationUDPList(const uint32_t entry,
Positions pos) const {
return pimpl->Parallel(&Module::getDestinationUDPList, pos, entry);
}
void Detector::setDestinationUDPList(const defs::udpDestination dest,
void Detector::setDestinationUDPList(const UdpDestination dest,
const int module_id) {
if (module_id == -1 && size() > 1) {
throw sls::RuntimeError("Cannot set this parameter at detector level.");

View File

@ -939,31 +939,30 @@ void Module::setSourceUDPMAC2(const sls::MacAddr mac) {
sendToDetector(F_SET_SOURCE_UDP_MAC2, mac, nullptr);
}
slsDetectorDefs::udpDestination
Module::getDestinationUDPList(const uint32_t entry) const {
return sendToDetector<udpDestination>(F_GET_DEST_UDP_LIST, entry);
sls::UdpDestination Module::getDestinationUDPList(const uint32_t entry) const {
return sendToDetector<sls::UdpDestination>(F_GET_DEST_UDP_LIST, entry);
}
void Module::setDestinationUDPList(const slsDetectorDefs::udpDestination dest) {
void Module::setDestinationUDPList(const sls::UdpDestination dest) {
// set them in the default way so the receivers are also set up
if (dest.entry_ == 0) {
if (dest.port_ != 0) {
setDestinationUDPPort(dest.port_);
if (dest.entry == 0) {
if (dest.port != 0) {
setDestinationUDPPort(dest.port);
}
if (dest.ip_ != 0) {
setDestinationUDPIP(IpAddr(dest.ip_));
if (dest.ip != 0) {
setDestinationUDPIP(dest.ip);
}
if (dest.mac_ != 0) {
setDestinationUDPMAC(MacAddr(dest.mac_));
if (dest.mac != 0) {
setDestinationUDPMAC(dest.mac);
}
if (dest.port2_ != 0) {
setDestinationUDPPort2(dest.port2_);
if (dest.port2 != 0) {
setDestinationUDPPort2(dest.port2);
}
if (dest.ip2_ != 0) {
setDestinationUDPIP2(IpAddr(dest.ip2_));
if (dest.ip2 != 0) {
setDestinationUDPIP2(dest.ip2);
}
if (dest.mac2_ != 0) {
setDestinationUDPMAC2(MacAddr(dest.mac2_));
if (dest.mac2 != 0) {
setDestinationUDPMAC2(dest.mac2);
}
} else {
sendToDetector(F_SET_DEST_UDP_LIST, dest, nullptr);

View File

@ -222,8 +222,8 @@ class Module : public virtual slsDetectorDefs {
void setSourceUDPMAC(const sls::MacAddr mac);
sls::MacAddr getSourceUDPMAC2() const;
void setSourceUDPMAC2(const sls::MacAddr mac);
udpDestination getDestinationUDPList(const uint32_t entry) const;
void setDestinationUDPList(const defs::udpDestination dest);
sls::UdpDestination getDestinationUDPList(const uint32_t entry) const;
void setDestinationUDPList(const sls::UdpDestination dest);
int getNumberofUDPDestinations() const;
void setNumberofUDPDestinations(const int value);
int getFirstUDPDestination() const;