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=5e64153b862306d51e61a0d7c65c95dfcc83e68f;hb=8841d87365ae75fdc5aea398554a6f08cbb2ce79;hpb=95d55c56c6967f2e85246bd168cf53fec4d3b9fd diff --git a/src/ngircd/conn.h b/src/ngircd/conn.h index 5e64153b..b9812156 100644 --- a/src/ngircd/conn.h +++ b/src/ngircd/conn.h @@ -2,16 +2,15 @@ * ngIRCd -- The Next Generation IRC Daemon * 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 ngIRCd 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.14 2002/03/29 22:54:35 alex Exp $ + * $Id: conn.h,v 1.26 2002/12/18 13:50:22 alex Exp $ * - * conn.h: Verwaltung aller Netz-Verbindungen ("connections") (Header) + * Connection management (header) */ @@ -19,33 +18,70 @@ #define __conn_h__ -#include +#include /* wg. time_t, s.u. */ + + +#ifdef USE_ZLIB +#define CONN_ZIP 4 /* Kompression mit zlib */ +#endif typedef INT CONN_ID; -typedef struct _Res_Stat -{ - INT pid; /* PID des Child-Prozess */ - INT pipe[2]; /* Pipe fuer IPC */ -} RES_STAT; +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_Init( VOID ); -GLOBAL VOID Conn_Exit( VOID ); +GLOBAL VOID Conn_Close PARAMS(( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )); -GLOBAL BOOLEAN Conn_NewListener( CONST UINT Port ); +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_Handler( INT Timeout ); +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 BOOLEAN Conn_Write( CONN_ID Idx, CHAR *Data, INT Len ); -GLOBAL BOOLEAN Conn_WriteStr( CONN_ID Idx, CHAR *Format, ... ); +GLOBAL VOID Conn_ResetWCounter PARAMS(( VOID )); +GLOBAL LONG Conn_WCounter PARAMS(( VOID )); -GLOBAL VOID Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient ); -GLOBAL VOID Conn_UpdateIdle( CONN_ID Idx ); -GLOBAL time_t Conn_GetIdle( CONN_ID Idx ); -GLOBAL time_t Conn_LastPing( CONN_ID Idx ); +GLOBAL INT Conn_MaxFD; #endif