]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/unix.h
Add support for AF_UNIX
[libs/net.git] / source / net / unix.h
diff --git a/source/net/unix.h b/source/net/unix.h
new file mode 100644 (file)
index 0000000..821e915
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef MSP_NET_UNIX_H_
+#define MSP_NET_UNIX_H_
+
+#include "sockaddr.h"
+
+namespace Msp {
+namespace Net {
+
+class UnixAddr: public SockAddr
+{
+private:
+       std::string path;
+       bool abstract;
+
+public:
+       UnixAddr();
+       UnixAddr(const SysAddr &);
+       UnixAddr(const std::string &, bool = false);
+
+       virtual UnixAddr *copy() const { return new UnixAddr(*this); }
+
+       virtual SysAddr to_sys() const;
+
+       virtual Family get_family() const { return UNIX; }
+       virtual std::string str() const;
+};
+
+} // namespace Net
+} // namespace Msp
+
+#endif