summaryrefslogtreecommitdiff
path: root/include/socket.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:48:16 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:48:16 +0000
commitca749a589afc4f12de4bfb0f63591a49e3703372 (patch)
treefff42f1513ba7aaa7b6b1b385e74dbaeefd1e526 /include/socket.h
parenta1f48c0d46d01415e9e93bfd8bfdba9d52ca795e (diff)
Add irc::sockets::satouser for user-readable IP/port pairs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11627 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/socket.h')
-rw-r--r--include/socket.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/socket.h b/include/socket.h
index 593550018..d3a45475d 100644
--- a/include/socket.h
+++ b/include/socket.h
@@ -115,6 +115,12 @@ namespace irc
* @return true if the conversion was successful, false if unknown address family
*/
CoreExport bool satoap(const irc::sockets::sockaddrs* sa, std::string& addr, int &port);
+ /** Convert a binary sockaddr to a user-readable string.
+ * This means IPv6 addresses are written as [::1]:6667, and *:6668 is used for 0.0.0.0:6668
+ * @param sa The structure to convert
+ * @return The string; "<unknown>" if not a valid address
+ */
+ CoreExport std::string satouser(const irc::sockets::sockaddrs* sa);
}
}