summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
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 /src/helperfuncs.cpp
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 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 26f92c4df..9ba9d7b39 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -165,11 +165,11 @@ void Write_NoFormat(int sock, const char *text)
{
bytes = snprintf(tb,MAXBUF,"%s\r\n",text);
- if (Config->GetIOHook(fd_ref_table[sock]->port))
+ if (Config->GetIOHook(fd_ref_table[sock]->GetPort()))
{
try
{
- Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
+ Config->GetIOHook(fd_ref_table[sock]->GetPort())->OnRawSocketWrite(sock,tb,bytes);
}
catch (ModuleException& modexcept)
{
@@ -213,11 +213,11 @@ void Write(int sock, char *text, ...)
va_end(argsPtr);
bytes = snprintf(tb,MAXBUF,"%s\r\n",textbuffer);
- if (Config->GetIOHook(fd_ref_table[sock]->port))
+ if (Config->GetIOHook(fd_ref_table[sock]->GetPort()))
{
try
{
- Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
+ Config->GetIOHook(fd_ref_table[sock]->GetPort())->OnRawSocketWrite(sock,tb,bytes);
}
catch (ModuleException& modexcept)
{
@@ -249,11 +249,11 @@ void WriteServ_NoFormat(int sock, const char* text)
{
bytes = snprintf(tb,MAXBUF,":%s %s\r\n",Config->ServerName,text);
- if (Config->GetIOHook(fd_ref_table[sock]->port))
+ if (Config->GetIOHook(fd_ref_table[sock]->GetPort()))
{
try
{
- Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
+ Config->GetIOHook(fd_ref_table[sock]->GetPort())->OnRawSocketWrite(sock,tb,bytes);
}
catch (ModuleException& modexcept)
{
@@ -313,11 +313,11 @@ void WriteFrom_NoFormat(int sock, userrec *user, const char* text)
{
bytes = snprintf(tb,MAXBUF,":%s %s\r\n",user->GetFullHost(),text);
- if (Config->GetIOHook(fd_ref_table[sock]->port))
+ if (Config->GetIOHook(fd_ref_table[sock]->GetPort()))
{
try
{
- Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
+ Config->GetIOHook(fd_ref_table[sock]->GetPort())->OnRawSocketWrite(sock,tb,bytes);
}
catch (ModuleException& modexcept)
{
@@ -360,11 +360,11 @@ void WriteFrom(int sock, userrec *user,char* text, ...)
va_end(argsPtr);
bytes = snprintf(tb,MAXBUF,":%s %s\r\n",user->GetFullHost(),textbuffer);
- if (Config->GetIOHook(fd_ref_table[sock]->port))
+ if (Config->GetIOHook(fd_ref_table[sock]->GetPort()))
{
try
{
- Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
+ Config->GetIOHook(fd_ref_table[sock]->GetPort())->OnRawSocketWrite(sock,tb,bytes);
}
catch (ModuleException& modexcept)
{
@@ -1405,7 +1405,7 @@ ConnectClass GetClass(userrec *user)
{
for (ClassVector::iterator i = Config->Classes.begin(); i != Config->Classes.end(); i++)
{
- if ((match(insp_ntoa(user->ip4),i->host.c_str())) || (match(user->host,i->host.c_str())))
+ if ((match(user->GetIPString(),i->host.c_str())) || (match(user->host,i->host.c_str())))
{
return *i;
}