]> arthur.barton.de Git - ngircd-alex.git/commitdiff
New function Conn_IPA(): get client IP address as string
authorAlexander Barton <alex@barton.de>
Sat, 22 May 2010 14:35:02 +0000 (16:35 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 24 Jun 2010 22:33:00 +0000 (00:33 +0200)
src/ngircd/conn-func.c
src/ngircd/conn-func.h

index 196325eea1aa82ee6083e04d7a94a5866c22e3ad..15bc7cc2663c1f0b94ff21e58da7043274ce17e2 100644 (file)
@@ -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 )
index 9a1859d38ce7a15684526016133b72bda43cbb0c..d504592f9a76a9e51590158819805341939db298 100644 (file)
@@ -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 ));