repo: ngircd action: commit revision: path_from: revision_from: 60eac5e952ef4096557d63e323e34498cc88928f: path_to: revision_to:
commit 60eac5e952ef4096557d63e323e34498cc88928f Author: Alexander BartonDate: Sat May 22 16:35:02 2010 +0200 New function Conn_IPA(): get client IP address as string diff --git a/src/ngircd/conn-func.c b/src/ngircd/conn-func.c
--- a/src/ngircd/conn-func.c
+++ b/src/ngircd/conn-func.c
@@ -273,6 +273,16 @@ Conn_RecvBytes( CONN_ID Idx )
return My_Connections[Idx].bytes_in;
} /* Conn_RecvBytes */
+/**
+ * Return the remote IP address of this connection as string.
+ */
+GLOBAL const char *
+Conn_IPA(CONN_ID Idx)
+{
+ assert (Idx > NONE);
+ return ng_ipaddr_tostr(&My_Connections[Idx].addr);
+}
+
GLOBAL void
Conn_ResetWCounter( void )
diff --git a/src/ngircd/conn-func.h b/src/ngircd/conn-func.h
--- a/src/ngircd/conn-func.h +++ b/src/ngircd/conn-func.h @@ -39,6 +39,7 @@ GLOBAL long Conn_SendMsg PARAMS(( CONN_ID Idx )); GLOBAL long Conn_RecvMsg PARAMS(( CONN_ID Idx )); GLOBAL long Conn_SendBytes PARAMS(( CONN_ID Idx )); GLOBAL long Conn_RecvBytes PARAMS(( CONN_ID Idx )); +GLOBAL const char *Conn_IPA PARAMS(( CONN_ID Idx )); GLOBAL void Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds )); GLOBAL void Conn_ResetPenalty PARAMS(( CONN_ID Idx ));
-----END OF PAGE-----