]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/conn.h
2980157780d80412277f60c6396a12d875a753b0
[ngircd-alex.git] / src / ngircd / conn.h
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
4  *
5  * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
6  * der GNU General Public License (GPL), wie von der Free Software Foundation
7  * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
8  * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
9  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
10  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
11  *
12  * $Id: conn.h,v 1.24 2002/12/02 13:19:37 alex Exp $
13  *
14  * conn.h: Verwaltung aller Netz-Verbindungen ("connections") (Header)
15  */
16
17
18 #ifndef __conn_h__
19 #define __conn_h__
20
21
22 #include <time.h>                       /* wg. time_t, s.u. */
23
24
25 #ifdef USE_ZLIB
26 #define CONN_ZIP 4                      /* Kompression mit zlib */
27 #endif
28
29
30 typedef INT CONN_ID;
31
32
33 GLOBAL VOID Conn_Init PARAMS((VOID ));
34 GLOBAL VOID Conn_Exit PARAMS(( VOID ));
35
36 GLOBAL INT Conn_InitListeners PARAMS(( VOID ));
37 GLOBAL VOID Conn_ExitListeners PARAMS(( VOID ));
38
39 GLOBAL BOOLEAN Conn_NewListener PARAMS(( CONST UINT Port ));
40
41 GLOBAL VOID Conn_Handler PARAMS(( VOID ));
42
43 GLOBAL BOOLEAN Conn_Write PARAMS(( CONN_ID Idx, CHAR *Data, INT Len ));
44 GLOBAL BOOLEAN Conn_WriteStr PARAMS(( CONN_ID Idx, CHAR *Format, ... ));
45
46 GLOBAL VOID Conn_Close PARAMS(( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient ));
47
48 GLOBAL VOID Conn_UpdateIdle PARAMS(( CONN_ID Idx ));
49 GLOBAL time_t Conn_GetIdle PARAMS(( CONN_ID Idx ));
50 GLOBAL time_t Conn_LastPing PARAMS(( CONN_ID Idx ));
51 GLOBAL time_t Conn_StartTime PARAMS(( CONN_ID Idx ));
52 GLOBAL INT Conn_SendQ PARAMS(( CONN_ID Idx ));
53 GLOBAL INT Conn_RecvQ PARAMS(( CONN_ID Idx ));
54 GLOBAL LONG Conn_SendMsg PARAMS(( CONN_ID Idx ));
55 GLOBAL LONG Conn_RecvMsg PARAMS(( CONN_ID Idx ));
56 GLOBAL LONG Conn_SendBytes PARAMS(( CONN_ID Idx ));
57 GLOBAL LONG Conn_RecvBytes PARAMS(( CONN_ID Idx ));
58
59 GLOBAL VOID Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds ));
60 GLOBAL VOID Conn_ResetPenalty PARAMS(( CONN_ID Idx ));
61
62 GLOBAL VOID Conn_ClearFlags PARAMS(( VOID ));
63 GLOBAL INT Conn_Flag PARAMS(( CONN_ID Idx ));
64 GLOBAL VOID Conn_SetFlag PARAMS(( CONN_ID Idx, INT Flag ));
65
66 GLOBAL VOID Conn_SetServer PARAMS(( CONN_ID Idx, INT ConfServer ));
67
68 GLOBAL CONN_ID Conn_First PARAMS(( VOID ));
69 GLOBAL CONN_ID Conn_Next PARAMS(( CONN_ID Idx ));
70
71 GLOBAL VOID Conn_SetOption PARAMS(( CONN_ID Idx, INT Option ));
72 GLOBAL VOID Conn_UnsetOption PARAMS(( CONN_ID Idx, INT Option ));
73 GLOBAL INT Conn_Options PARAMS(( CONN_ID Idx ));
74
75 #ifdef USE_ZLIB
76 GLOBAL BOOLEAN Conn_InitZip PARAMS(( CONN_ID Idx ));
77 GLOBAL LONG Conn_SendBytesZip PARAMS(( CONN_ID Idx ));
78 GLOBAL LONG Conn_RecvBytesZip PARAMS(( CONN_ID Idx ));
79 #endif
80
81
82 GLOBAL INT Conn_MaxFD;
83
84
85 #endif
86
87
88 /* -eof- */