added new IPv4Address class
[libasyncio] / utils / asyncio_system_tools.cpp
index 649cd84..e505473 100644 (file)
@@ -30,6 +30,8 @@ on this file might be covered by the GNU General Public License.
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <netinet/in.h>
+
 
 namespace AsyncIo
 {
@@ -93,6 +95,30 @@ bool unlink( const std::string& path )
 
 
 
+/*
+ * IPv4
+ */
+
+IPv4Address::IPv4Address( )
+: m_address( 0u )
+, m_valid( false )
+{
+}
+
+
+IPv4Address::IPv4Address(uint32_t _address)
+: m_address( _address )
+, m_valid( true )
+{
+}
+
+
+uint32_t IPv4Address::get_address_nbo() const
+{
+    return htonl( m_address );
+}
+
+
 
 } // end of namespace Utils
 }// end of namespace AsyncIo