summaryrefslogtreecommitdiff
path: root/include/users.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:07:36 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-01 15:07:36 +0000
commit7a672d42e4173e274ac0ee31331d41e45801facc (patch)
tree72ad0edb4d7a8b8cf0be854b784c328b6757327a /include/users.h
parent6278262baaed06e2acf134c53ed0485136d61f50 (diff)
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
Diffstat (limited to 'include/users.h')
-rw-r--r--include/users.h27
1 files changed, 18 insertions, 9 deletions
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();