return "invalid "+string(gai_strerror(retval));
}
+ //! Ignores any interface specifiers possibly available in the sockaddr data.
+ string toStringNoInterface() const
+ {
+ char host[1024];
+ if(sin4.sin_family == AF_INET && (nullptr != inet_ntop(sin4.sin_family, &sin4.sin_addr, host, sizeof(host))))
+ return string(host);
+ else if(sin4.sin_family == AF_INET6 && (nullptr != inet_ntop(sin4.sin_family, &sin6.sin6_addr, host, sizeof(host))))
+ return string(host);
+ else
+ return "invalid "+stringerror();
+ }
+
string toStringWithPort() const
{
if(sin4.sin_family==AF_INET)
string toString() const
{
- return d_network.toString()+"/"+std::to_string((unsigned int)d_bits);
+ return d_network.toStringNoInterface()+"/"+std::to_string((unsigned int)d_bits);
}
string toStringNoMask() const
{
- return d_network.toString();
+ return d_network.toStringNoInterface();
}
const ComboAddress& getNetwork() const
(CASE_S(QType::APL,"2:20::/16", "\x00\x02\x10\x02\x00\x20"))
(CASE_S(QType::APL,"2:2000::/8", "\x00\x02\x08\x01\x20"))
(CASE_S(QType::APL,"2:fe00::/8", "\x00\x02\x08\x01\xfe"))
+ (CASE_S(QType::APL,"2:fe80::/16", "\x00\x02\x10\x02\xfe\x80"))
(CASE_S(QType::APL,"2:2001:db8::/32", "\x00\x02\x20\x04\x20\x01\x0d\xb8"))
(CASE_S(QType::APL,"2:2001:db8::/30", "\x00\x02\x1e\x04\x20\x01\x0d\xb8"))
(CASE_S(QType::APL,"2:2001::1/128", "\x00\x02\x80\x10\x20\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"))
(CASE_S(QType::APL,"!2:2001::1/128", "\x00\x02\x80\x90\x20\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"))
(CASE_S(QType::APL,"2:2001:db8:5678:9910:8bc:3359:b2e8:720e/128", "\x00\x02\x80\x10\x20\x01\x0d\xb8\x56\x78\x99\x10\x08\xbc\x33\x59\xb2\xe8\x72\x0e"))
+ (CASE_S(QType::APL,"2:fe80:1234:5678:9910:8bc:3359:b2e8:720e/128", "\x00\x02\x80\x10\xfe\x80\x12\x34\x56\x78\x99\x10\x08\xbc\x33\x59\xb2\xe8\x72\x0e"))
(CASE_S(QType::APL,"2:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128","\x00\x02\x80\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"))
(CASE_S(QType::APL,"", ""))
(CASE_S(QType::APL,"1:10.0.0.0/32 1:10.1.1.1/32", "\x00\x01\x20\x01\x0a\x00\x01\x20\x04\x0a\x01\x01\x01"))