summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-04 01:59:41 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-04 01:59:41 +0000
commitf25755bbe748f65eb17f8e25507160569f8f4041 (patch)
tree31c4e662f99cd6e2b3c38ab01b32c55a29f9f3eb /include
parente5843dde4dda51de3160de62b7b8811cb9465d1b (diff)
Change to using userrec::ip as a sockaddr to store port, ip and address family, rather than userrec::ip4 and userrec::port.
This allows us to handle remote ipv6 users on an ipv4 server, and vice versa. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4694 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/connection.h12
-rw-r--r--include/users.h18
2 files changed, 19 insertions, 11 deletions
diff --git a/include/connection.h b/include/connection.h
index 6f918204d..2855fa226 100644
--- a/include/connection.h
+++ b/include/connection.h
@@ -21,8 +21,6 @@
#include "inspircd_config.h"
#include "base.h"
-/** Please note: classes serverrec and userrec both inherit from class connection.
- */
class connection : public Extensible
{
public:
@@ -30,7 +28,7 @@ class connection : public Extensible
*/
int fd;
- /** Hostname of connection. Not used if this is a serverrec
+ /** Hostname of connection
*/
char host[65];
@@ -50,16 +48,10 @@ class connection : public Extensible
*/
int cmds_out;
- /** True if server/user has authenticated, false if otherwise
+ /** True if user has authenticated, false if otherwise
*/
bool haspassed;
- /** Port number
- * For a userrec, this is the port they connected to the network on.
- * For a serverrec this is the current listening port of the serverrec object.
- */
- int port;
-
/** Used by userrec to indicate the registration status of the connection
*/
char registered;
diff --git a/include/users.h b/include/users.h
index 13dc33709..19116a130 100644
--- a/include/users.h
+++ b/include/users.h
@@ -268,7 +268,23 @@ class userrec : public connection
/** IPV4 ip address
*/
- insp_inaddr ip4;
+ sockaddr ip;
+
+ /** Initialize the clients sockaddr
+ */
+ void SetSockAddr(int protocol_family, const char* ip, int port);
+
+ /** Get port number from sockaddr
+ */
+ int GetPort();
+
+ /** Get protocol family from sockaddr
+ */
+ int GetProtocolFamily();
+
+ /** Get IP string from sockaddr
+ */
+ const char* GetIPString();
/* Write error string
*/