X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=include%2Fsocket.h;h=e527bc7f54aa89c86b53253e6a38f4056f80882a;hb=21e7efdadfa685ac1ddcb0a0a515502bc873302b;hp=6e9a2051840a558328bedc8b75aa9ed806329ceb;hpb=87e328a1fbfcacafc013ba580d31dd4123f1e7e2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/socket.h b/include/socket.h index 6e9a20518..e527bc7f5 100644 --- a/include/socket.h +++ b/include/socket.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ namespace irc struct sockaddr sa; struct sockaddr_in in4; struct sockaddr_in6 in6; + struct sockaddr_un un; /** Return the family of the socket (e.g. AF_INET). */ int family() const; /** Return the size of the structure for syscall passing */ @@ -118,6 +120,13 @@ namespace irc * @return true if the conversion was successful, false if not. */ CoreExport bool aptosa(const std::string& addr, int port, irc::sockets::sockaddrs& sa); + + /** Convert a UNIX socket path to a binary sockaddr. + * @param path The path to the UNIX socket. + * @param sa The structure to place the result in. Will be zeroed prior to conversion. + * @return True if the conversion was successful; otherwise, false. + */ + CoreExport bool untosa(const std::string& path, irc::sockets::sockaddrs& sa); } }