X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconn.h;h=b9812156b83d077c1b63ed466c1c23b62fd1040e;hp=165c48969f13d230033fce695c10a7086f410fc1;hb=4f6f84e7e1bc015e201e8a79e13b0906dcb23ec1;hpb=933e62fb7d72c9ab386de7571ea45c125c54cbe8 diff --git a/src/ngircd/conn.h b/src/ngircd/conn.h index 165c4896..b9812156 100644 --- a/src/ngircd/conn.h +++ b/src/ngircd/conn.h @@ -1,28 +1,16 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001 by Alexander Barton (alex@barton.de) + * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) * - * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen - * der GNU General Public License (GPL), wie von der Free Software Foundation - * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 - * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. - * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste - * der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * Please read the file COPYING, README and AUTHORS for more information. * - * $Id: conn.h,v 1.3 2001/12/14 08:15:45 alex Exp $ - * - * conn.h: Verwaltung aller Netz-Verbindungen ("connections") (Header) - * - * $Log: conn.h,v $ - * Revision 1.3 2001/12/14 08:15:45 alex - * - CONN_ID wird definiert. - * - * Revision 1.2 2001/12/13 01:33:32 alex - * - Conn_Handler() unterstuetzt nun einen Timeout (in Sekunden). - * - * Revision 1.1 2001/12/12 17:18:38 alex - * - Modul zur Verwaltung aller Netzwerk-Verbindungen begonnen. + * $Id: conn.h,v 1.26 2002/12/18 13:50:22 alex Exp $ * + * Connection management (header) */ @@ -30,15 +18,70 @@ #define __conn_h__ +#include /* wg. time_t, s.u. */ + + +#ifdef USE_ZLIB +#define CONN_ZIP 4 /* Kompression mit zlib */ +#endif + + typedef INT CONN_ID; -GLOBAL VOID Conn_Init( VOID ); -GLOBAL VOID Conn_Exit( VOID ); +GLOBAL VOID Conn_Init PARAMS((VOID )); +GLOBAL VOID Conn_Exit PARAMS(( VOID )); + +GLOBAL INT Conn_InitListeners PARAMS(( VOID )); +GLOBAL VOID Conn_ExitListeners PARAMS(( VOID )); + +GLOBAL BOOLEAN Conn_NewListener PARAMS(( CONST UINT Port )); + +GLOBAL VOID Conn_Handler PARAMS(( VOID )); + +GLOBAL BOOLEAN Conn_Write PARAMS(( CONN_ID Idx, CHAR *Data, INT Len )); +GLOBAL BOOLEAN Conn_WriteStr PARAMS(( CONN_ID Idx, CHAR *Format, ... )); + +GLOBAL VOID Conn_Close PARAMS(( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )); + +GLOBAL VOID Conn_UpdateIdle PARAMS(( CONN_ID Idx )); +GLOBAL time_t Conn_GetIdle PARAMS(( CONN_ID Idx )); +GLOBAL time_t Conn_LastPing PARAMS(( CONN_ID Idx )); +GLOBAL time_t Conn_StartTime PARAMS(( CONN_ID Idx )); +GLOBAL INT Conn_SendQ PARAMS(( CONN_ID Idx )); +GLOBAL INT Conn_RecvQ PARAMS(( CONN_ID Idx )); +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 VOID Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds )); +GLOBAL VOID Conn_ResetPenalty PARAMS(( CONN_ID Idx )); + +GLOBAL VOID Conn_ClearFlags PARAMS(( VOID )); +GLOBAL INT Conn_Flag PARAMS(( CONN_ID Idx )); +GLOBAL VOID Conn_SetFlag PARAMS(( CONN_ID Idx, INT Flag )); + +GLOBAL VOID Conn_SetServer PARAMS(( CONN_ID Idx, INT ConfServer )); + +GLOBAL CONN_ID Conn_First PARAMS(( VOID )); +GLOBAL CONN_ID Conn_Next PARAMS(( CONN_ID Idx )); + +GLOBAL VOID Conn_SetOption PARAMS(( CONN_ID Idx, INT Option )); +GLOBAL VOID Conn_UnsetOption PARAMS(( CONN_ID Idx, INT Option )); +GLOBAL INT Conn_Options PARAMS(( CONN_ID Idx )); + +#ifdef USE_ZLIB +GLOBAL BOOLEAN Conn_InitZip PARAMS(( CONN_ID Idx )); +GLOBAL LONG Conn_SendBytesZip PARAMS(( CONN_ID Idx )); +GLOBAL LONG Conn_RecvBytesZip PARAMS(( CONN_ID Idx )); +#endif + +GLOBAL VOID Conn_ResetWCounter PARAMS(( VOID )); +GLOBAL LONG Conn_WCounter PARAMS(( VOID )); -GLOBAL BOOLEAN Conn_New_Listener( CONST INT Port ); -GLOBAL VOID Conn_Handler( INT Timeout ); +GLOBAL INT Conn_MaxFD; #endif