conflict resolved, changed to using hex() instead of str() in configuremac

This commit is contained in:
2019-04-03 14:11:01 +02:00
30 changed files with 711 additions and 507 deletions

View File

@@ -19,7 +19,11 @@ namespace sls {
IpAddr::IpAddr(const std::string &address) {
inet_pton(AF_INET, address.c_str(), &addr_);
}
IpAddr::IpAddr(const char *address) { inet_pton(AF_INET, address, &addr_); }
IpAddr::IpAddr(const char *address) {
inet_pton(AF_INET, address, &addr_);
}
std::string IpAddr::str() const {
char ipstring[INET_ADDRSTRLEN]{};
inet_ntop(AF_INET, &addr_, ipstring, INET_ADDRSTRLEN);
@@ -57,6 +61,14 @@ std::string MacAddr::to_hex(const char delimiter) const {
return ss.str();
}
std::string MacAddr::str() const {
return to_hex(':');
}
std::string MacAddr::hex() const {
return to_hex();
}
std::ostream &operator<<(std::ostream &out, const IpAddr &addr) {
return out << addr.str();
}