diff --git a/ip.cpp.rl b/ip.cpp.rl index 0eb397f6..b0e0e696 100644 --- a/ip.cpp.rl +++ b/ip.cpp.rl @@ -35,6 +35,11 @@ const range ipv4::WELL_KNOWN_PORT ( 0, 1023), ipv4::PRIVATE_PORT (49152, 65535); +ipv4::ip::ip (uint32_t _integer): + m_integer (_integer) +{ ; } + + 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 e1202129..feecf3f7 100644 --- a/ip.hpp +++ b/ip.hpp @@ -34,6 +34,7 @@ namespace ipv4 { }; ip (const std::string &); + ip (uint32_t i); ip (uint8_t a, uint8_t b, uint8_t c, uint8_t d); ip& operator = (const ip &);