From 7a672d42e4173e274ac0ee31331d41e45801facc Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 1 Sep 2009 15:07:36 +0000 Subject: Remove more text<->binary IP conversions, making code more IPv4/IPv6 independent git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11578 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/users.h | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'include/users.h') diff --git a/include/users.h b/include/users.h index e681ef326..39b0ebdca 100644 --- a/include/users.h +++ b/include/users.h @@ -472,23 +472,32 @@ class CoreExport User : public EventHandler */ bool quitting; - /** IPV4 or IPV6 ip address, binary format. Use SetSockAddr to set this and - * GetIPString/GetPort to obtain its value in a readable manner + /** Server address and port that this user is connected to. + * If unknown, address family is AF_UNKNOWN */ - irc::sockets::sockaddrs ip; + irc::sockets::sockaddrs server_sa; + /** Client address that the user is connected from. + * Port number is only valid if local. + * + * Do not modify this value directly, use SetClientIP() to change it + */ + irc::sockets::sockaddrs client_sa; - /** Initialize the clients sockaddr - * @param ip A human-readable IP address for this user - * @param port The port number of this user (zero if unknown) + /** Sets the client IP for this user + * @return true if the conversion was successful */ - void SetSockAddr(const char* ip, int port); + bool SetClientIP(const char* sip); - /** Get port number from sockaddr + /** * @return The port number of this user. */ int GetServerPort(); + /** + * @return The server IP address + */ + std::string GetServerIP(); - /** Get IP string from sockaddr, using static internal buffer + /** Get client IP string from sockaddr, using static internal buffer * @return The IP string */ const char* GetIPString(); -- cgit v1.2.3