binaries in

This commit is contained in:
2021-09-07 16:44:35 +02:00
31 changed files with 167 additions and 167 deletions

View File

@ -148,31 +148,6 @@ std::ostream &operator<<(std::ostream &os,
return os << ToString(r);
}
std::string ToString(const slsDetectorDefs::udpDestination &r) {
std::ostringstream oss;
oss << '[' << std::endl
<< "entry " << r.entry_ << std::endl
<< "ip " << IpAddr(r.ip_) << std::endl
<< "mac " << MacAddr(r.mac_) << std::endl
<< "port " << r.port_ << std::endl;
if (r.port2_ != 0) {
oss << "port2 " << r.port2_ << std::endl;
}
if (r.ip2_ != 0) {
oss << "ip2 " << IpAddr(r.ip2_) << std::endl;
}
if (r.mac2_ != 0) {
oss << "mac2 " << MacAddr(r.mac2_) << std::endl;
}
oss << ']';
return oss.str();
}
std::ostream &operator<<(std::ostream &os,
const slsDetectorDefs::udpDestination &r) {
return os << ToString(r);
}
std::string ToString(const defs::runStatus s) {
switch (s) {
case defs::ERROR:

View File

@ -69,6 +69,26 @@ std::string MacAddr::str() const { return to_hex(':'); }
std::string MacAddr::hex() const { return to_hex(); }
std::string UdpDestination::str() const {
std::ostringstream oss;
oss << '[' << std::endl
<< "entry " << entry << std::endl
<< "ip " << ip << std::endl
<< "mac " << mac << std::endl
<< "port " << port << std::endl;
if (port2 != 0) {
oss << "port2 " << port2 << std::endl;
}
if (ip2 != 0) {
oss << "ip2 " << ip2 << std::endl;
}
if (mac2 != 0) {
oss << "mac2 " << mac2 << std::endl;
}
oss << ']';
return oss.str();
}
std::ostream &operator<<(std::ostream &out, const IpAddr &addr) {
return out << addr.str();
}
@ -77,6 +97,10 @@ std::ostream &operator<<(std::ostream &out, const MacAddr &addr) {
return out << addr.str();
}
std::ostream &operator<<(std::ostream &out, const UdpDestination &dest) {
return out << dest.str();
}
IpAddr HostnameToIp(const char *hostname) {
addrinfo hints;
addrinfo *result = nullptr;