Commit Diff


commit - 139d6303e73079f48adfe37be2b88efed31e47df
commit + 60eac5e952ef4096557d63e323e34498cc88928f
blob - 196325eea1aa82ee6083e04d7a94a5866c22e3ad
blob + 15bc7cc2663c1f0b94ff21e58da7043274ce17e2
--- src/ngircd/conn-func.c
+++ src/ngircd/conn-func.c
@@ -272,6 +272,16 @@ Conn_RecvBytes( CONN_ID Idx )
 	assert( Idx > NONE );
 	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
blob - 9a1859d38ce7a15684526016133b72bda43cbb0c
blob + d504592f9a76a9e51590158819805341939db298
--- src/ngircd/conn-func.h
+++ 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 ));