X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconn-func.h;h=1d05acc88d5623979a371e80aedc3f4a61e480c8;hp=217ee3ec77767fde5849a1fa81da5a4e825d3e09;hb=3de972e0bdbb5da7b13db5628e5373e3ec57cf51;hpb=7daa7fb278bb426baf7ae51ca8191ef1edbf81d8 diff --git a/src/ngircd/conn-func.h b/src/ngircd/conn-func.h index 217ee3ec..1d05acc8 100644 --- a/src/ngircd/conn-func.h +++ b/src/ngircd/conn-func.h @@ -1,44 +1,50 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) + * Copyright (c)2001-2008 Alexander Barton (alex@barton.de) * * 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-func.h,v 1.4 2005/04/25 18:37:16 fw Exp $ - * - * Connection management: Global functions (header) */ - #ifndef __conn_func_h__ #define __conn_func_h__ +/** + * @file + * Connection management: Global functions (header) + */ /* Include the header conn.h if this header is _not_ included by any module * containing connection handling functions. So other modules must only * include this conn-func.h header. */ #ifndef CONN_MODULE -# include "conn.h" +#include "conn.h" +#else +#define Conn_OPTION_ADD( x, opt ) ( (x)->options |= (opt) ) +#define Conn_OPTION_DEL( x, opt ) ( (x)->options &= ~(opt) ) +#define Conn_OPTION_ISSET( x, opt ) ( ((x)->options & (opt)) != 0) #endif -GLOBAL void Conn_UpdateIdle PARAMS(( CONN_ID Idx )); +GLOBAL void Conn_UpdateIdle PARAMS((CONN_ID Idx)); +GLOBAL void Conn_UpdatePing PARAMS((CONN_ID Idx)); + +GLOBAL time_t Conn_GetSignon 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 size_t Conn_SendQ PARAMS(( CONN_ID Idx )); +GLOBAL size_t 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 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 )); GLOBAL void Conn_ClearFlags PARAMS(( void )); GLOBAL int Conn_Flag PARAMS(( CONN_ID Idx )); @@ -47,15 +53,12 @@ GLOBAL void Conn_SetFlag PARAMS(( CONN_ID Idx, int Flag )); GLOBAL CONN_ID Conn_First PARAMS(( void )); GLOBAL CONN_ID Conn_Next PARAMS(( CONN_ID Idx )); -GLOBAL int Conn_Options PARAMS(( CONN_ID Idx )); +GLOBAL UINT16 Conn_Options PARAMS(( CONN_ID Idx )); +GLOBAL void Conn_SetOption PARAMS(( CONN_ID Idx, int Option )); GLOBAL void Conn_ResetWCounter PARAMS(( void )); GLOBAL long Conn_WCounter PARAMS(( void )); -#define Conn_OPTION_ADD( x, opt ) ( (x)->options |= opt ) -#define Conn_OPTION_DEL( x, opt ) ( (x)->options &= ~opt ) -#define Conn_OPTION_ISSET( x, opt ) ( (x)->options & opt ) - #endif