]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/conn.h
68712a7cb642665bceb56cb8bdacd8c441802d8c
[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.23 2002/11/26 23:06:51 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
52 GLOBAL VOID Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds ));
53 GLOBAL VOID Conn_ResetPenalty PARAMS(( CONN_ID Idx ));
54
55 GLOBAL VOID Conn_ClearFlags PARAMS(( VOID ));
56 GLOBAL INT Conn_Flag PARAMS(( CONN_ID Idx ));
57 GLOBAL VOID Conn_SetFlag PARAMS(( CONN_ID Idx, INT Flag ));
58
59 GLOBAL VOID Conn_SetServer PARAMS(( CONN_ID Idx, INT ConfServer ));
60
61 GLOBAL CONN_ID Conn_First PARAMS(( VOID ));
62 GLOBAL CONN_ID Conn_Next PARAMS(( CONN_ID Idx ));
63
64 GLOBAL VOID Conn_SetOption PARAMS(( CONN_ID Idx, INT Option ));
65 GLOBAL VOID Conn_UnsetOption PARAMS(( CONN_ID Idx, INT Option ));
66 GLOBAL INT Conn_Options PARAMS(( CONN_ID Idx ));
67
68 #ifdef USE_ZLIB
69 GLOBAL BOOLEAN Conn_InitZip PARAMS(( CONN_ID Idx ));
70 #endif
71
72
73 GLOBAL INT Conn_MaxFD;
74
75
76 #endif
77
78
79 /* -eof- */