diff --git a/ip.cpp.rl b/ip.cpp.rl index b1a8995b..e22de767 100644 --- a/ip.cpp.rl +++ b/ip.cpp.rl @@ -27,6 +27,10 @@ using namespace std; +const ipv4::ip ipv4::ip::LOOPBACK ({ 127, 0, 0, 1 }); +const ipv4::ip ipv4::ip::ANY ({ 0, 0, 0, 0 }); + + ipv4::ip::ip (uint8_t a, uint8_t b, uint8_t c, uint8_t d): m_octets ({ a, b, c, d }) { ; } diff --git a/ip.hpp b/ip.hpp index 4829a5eb..a97597f3 100644 --- a/ip.hpp +++ b/ip.hpp @@ -34,6 +34,9 @@ namespace ipv4 { bool operator == (const ip &) const; static ip parse (const std::string &); + + static const ip LOOPBACK; + static const ip ANY; };