#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <netinet/in.h>
+
namespace AsyncIo
{
+/*
+ * 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
* @brief some functions to wrap some system functions
*
* @author Reinhard Pfau \<Reinhard.Pfau@gmx.de\>
+ *
* @copyright © Copyright 2009 by Intra2net AG
+ * @contact Intra2net Opensource Team \<opensource@intra2net.com\>
*/
}; // end of FileStat
+/*
+ * IPv4 support
+ */
+
+class IPv4Address
+{
+ public:
+ IPv4Address();
+ IPv4Address( uint32_t _address );
+
+ bool is_valid() const {return m_valid;}
+
+ uint32_t get_address() const { return m_address; }
+
+ uint32_t get_address_nbo() const;
+
+ private:
+
+ uint32_t m_address;
+ bool m_valid;
+}; // end of IPv4Address
+
+
} // end of namespace Utils
} // end of namespace AsyncIo