AK: Define IPv6Address::loopback(), the IPv6 loopback address '::1'

This commit is contained in:
Peter Brottveit Bock 2023-05-30 00:25:28 +02:00 committed by Sam Atkins
parent 43a8a38f57
commit 10aed80b29
Notes: sideshowbarker 2024-07-17 04:10:16 +09:00

View file

@ -251,6 +251,12 @@ public:
return {};
}
// https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.3
[[nodiscard]] static IPv6Address loopback()
{
return IPv6Address({ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 });
}
private:
constexpr u16 group(unsigned i) const
{