]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.h
ngIRCd Release 27
[ngircd-alex.git] / src / ngircd / conn.h
index a6cf53a47be4f3695e66f9fd74c76fcf56480a31..d53cb0c6685555c2b1f5337f920c87e4c25e375e 100644 (file)
@@ -40,7 +40,8 @@
 #define CONN_SSL               32      /* this connection is SSL encrypted */
 #define CONN_SSL_WANT_WRITE    64      /* SSL/TLS library needs to write protocol data */
 #define CONN_SSL_WANT_READ     128     /* SSL/TLS library needs to read protocol data */
-#define CONN_SSL_FLAGS_ALL     (CONN_SSL_CONNECT|CONN_SSL|CONN_SSL_WANT_WRITE|CONN_SSL_WANT_READ)
+#define CONN_SSL_PEERCERT_OK   256     /* peer presented a valid certificate (used to check inbound server auth */
+#define CONN_SSL_FLAGS_ALL     (CONN_SSL_CONNECT|CONN_SSL|CONN_SSL_WANT_WRITE|CONN_SSL_WANT_READ|CONN_SSL_PEERCERT_OK)
 #endif
 typedef int CONN_ID;
 
@@ -105,9 +106,17 @@ typedef struct _Connection
 #endif
 } CONNECTION;
 
-GLOBAL CONNECTION *My_Connections;
-GLOBAL CONN_ID Pool_Size;
-GLOBAL long WCounter;
+
+#ifdef CONN_MODULE_GLOBAL_INIT
+CONNECTION *My_Connections;
+CONN_ID Pool_Size;
+long WCounter;
+#else
+extern CONNECTION *My_Connections;
+extern CONN_ID Pool_Size;
+extern long WCounter;
+#endif
+
 
 #define CONNECTION2ID(x) (long)(x - My_Connections)
 
@@ -139,8 +148,8 @@ GLOBAL CONN_ID Conn_GetFromProc PARAMS((int fd));
 GLOBAL CLIENT* Conn_GetClient PARAMS((CONN_ID i));
 GLOBAL PROC_STAT* Conn_GetProcStat PARAMS((CONN_ID i));
 
-GLOBAL char *Conn_GetFingerprint PARAMS((CONN_ID Idx));
-GLOBAL bool Conn_SetFingerprint PARAMS((CONN_ID Idx, const char *fingerprint));
+GLOBAL char *Conn_GetCertFp PARAMS((CONN_ID Idx));
+GLOBAL bool Conn_SetCertFp PARAMS((CONN_ID Idx, const char *fingerprint));
 GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx));
 
 #ifdef SSL_SUPPORT
@@ -158,9 +167,7 @@ GLOBAL long Conn_GetAuthPing PARAMS((CONN_ID Idx));
 GLOBAL void Conn_SetAuthPing PARAMS((CONN_ID Idx, long ID));
 #endif
 
-#ifdef DEBUG
 GLOBAL void Conn_DebugDump PARAMS((void));
-#endif
 
 #endif