]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/inet.h
Prepare for assimilating msphttp
[libs/net.git] / source / net / inet.h
diff --git a/source/net/inet.h b/source/net/inet.h
new file mode 100644 (file)
index 0000000..639e64c
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef MSP_NET_INET_H_
+#define MSP_NET_INET_H_
+
+#include "sockaddr.h"
+
+namespace Msp {
+namespace Net {
+
+/**
+Address class for IPv4 sockets.
+*/
+class InetAddr: public SockAddr
+{
+private:
+       unsigned char addr[4];
+       unsigned port;
+
+public:
+       InetAddr();
+       InetAddr(const SysAddr &);
+
+       virtual InetAddr *copy() const { return new InetAddr(*this); }
+
+       virtual SysAddr to_sys() const;
+
+       virtual Family get_family() const { return INET; }
+       unsigned get_port() const { return port; }
+       virtual std::string str() const;
+};
+
+} // namespace Net
+} // namespace Msp
+
+#endif