0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-30 17:34:04 +01:00

ircd::net: Add constructions for ipport from rfc1035 resource records.

This commit is contained in:
Jason Volk 2018-02-03 11:06:16 -08:00
parent 46bf944227
commit a9ac7fd8d9
2 changed files with 20 additions and 0 deletions

View file

@ -74,6 +74,8 @@ struct ircd::net::ipport
ipport(const uint32_t &ip, const uint16_t &port);
ipport(const uint128_t &ip, const uint16_t &port);
ipport(const rfc1035::record::A &, const uint16_t &port);
ipport(const rfc1035::record::AAAA &, const uint16_t &port);
ipport(const boost::asio::ip::address &, const uint16_t &port);
ipport(const string_view &ip, const uint16_t &port);
ipport(const string_view &ip, const string_view &port);

View file

@ -2800,6 +2800,24 @@ ircd::net::ipport::ipport(const string_view &ip,
{
}
ircd::net::ipport::ipport(const rfc1035::record::A &rr,
const uint16_t &port)
:ipport
{
rr.ip4, port
}
{
}
ircd::net::ipport::ipport(const rfc1035::record::AAAA &rr,
const uint16_t &port)
:ipport
{
rr.ip6, port
}
{
}
ircd::net::ipport::ipport(const boost::asio::ip::address &address,
const uint16_t &port)
{