Blame


1 cbc1e59f 2001-12-12 alex /*
2 cbc1e59f 2001-12-12 alex * ngIRCd -- The Next Generation IRC Daemon
3 03d971d9 2002-01-02 alex * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
4 cbc1e59f 2001-12-12 alex *
5 6725d789 2002-12-12 alex * This program is free software; you can redistribute it and/or modify
6 6725d789 2002-12-12 alex * it under the terms of the GNU General Public License as published by
7 6725d789 2002-12-12 alex * the Free Software Foundation; either version 2 of the License, or
8 6725d789 2002-12-12 alex * (at your option) any later version.
9 6725d789 2002-12-12 alex * Please read the file COPYING, README and AUTHORS for more information.
10 cbc1e59f 2001-12-12 alex *
11 326607ee 2005-03-20 fw * $Id: conf.h,v 1.34 2005/03/20 13:54:06 fw Exp $
12 cbc1e59f 2001-12-12 alex *
13 6725d789 2002-12-12 alex * Configuration management (header)
14 cbc1e59f 2001-12-12 alex */
15 cbc1e59f 2001-12-12 alex
16 cbc1e59f 2001-12-12 alex
17 cbc1e59f 2001-12-12 alex #ifndef __conf_h__
18 cbc1e59f 2001-12-12 alex #define __conf_h__
19 cbc1e59f 2001-12-12 alex
20 03d971d9 2002-01-02 alex #include <time.h>
21 cbc1e59f 2001-12-12 alex
22 ca33cbda 2002-03-12 alex #include "defines.h"
23 8adff592 2005-03-19 fw #include "portab.h"
24 574ae82c 2001-12-26 alex
25 03d971d9 2002-01-02 alex typedef struct _Conf_Oper
26 03d971d9 2002-01-02 alex {
27 8adff592 2005-03-19 fw char name[CLIENT_PASS_LEN]; /* Name (ID) of IRC operator */
28 8adff592 2005-03-19 fw char pwd[CLIENT_PASS_LEN]; /* Password */
29 490c9d04 2005-03-02 alex char *mask;
30 03d971d9 2002-01-02 alex } CONF_OPER;
31 574ae82c 2001-12-26 alex
32 03d971d9 2002-01-02 alex typedef struct _Conf_Server
33 03d971d9 2002-01-02 alex {
34 8adff592 2005-03-19 fw char host[HOST_LEN]; /* Hostname */
35 8adff592 2005-03-19 fw char ip[16]; /* IP address (Resolver) */
36 8adff592 2005-03-19 fw char name[CLIENT_ID_LEN]; /* IRC-Client-ID */
37 8adff592 2005-03-19 fw char pwd_in[CLIENT_PASS_LEN]; /* Password which must be received */
38 8adff592 2005-03-19 fw char pwd_out[CLIENT_PASS_LEN]; /* Password to send to peer */
39 8adff592 2005-03-19 fw UINT16 port; /* Server port */
40 8adff592 2005-03-19 fw int group; /* Group of server */
41 6725d789 2002-12-12 alex time_t lasttry; /* Last connect attempt */
42 6725d789 2002-12-12 alex RES_STAT *res_stat; /* Status of the resolver */
43 8adff592 2005-03-19 fw int flags; /* Flags */
44 a2544e49 2002-12-30 alex CONN_ID conn_id; /* ID of server connection or NONE */
45 03d971d9 2002-01-02 alex } CONF_SERVER;
46 574ae82c 2001-12-26 alex
47 040f5422 2002-05-21 alex typedef struct _Conf_Channel
48 040f5422 2002-05-21 alex {
49 8adff592 2005-03-19 fw char name[CHANNEL_NAME_LEN]; /* Name of the channel */
50 8adff592 2005-03-19 fw char modes[CHANNEL_MODE_LEN]; /* Initial channel modes */
51 8adff592 2005-03-19 fw char topic[CHANNEL_TOPIC_LEN]; /* Initial topic */
52 040f5422 2002-05-21 alex } CONF_CHANNEL;
53 574ae82c 2001-12-26 alex
54 040f5422 2002-05-21 alex
55 281f7583 2002-12-31 alex #define CONF_SFLAG_ONCE 1 /* Delete this entry after next disconnect */
56 281f7583 2002-12-31 alex #define CONF_SFLAG_DISABLED 2 /* This server configuration entry is disabled */
57 281f7583 2002-12-31 alex
58 281f7583 2002-12-31 alex
59 6725d789 2002-12-12 alex /* Name ("Nick") of the servers */
60 8adff592 2005-03-19 fw GLOBAL char Conf_ServerName[CLIENT_ID_LEN];
61 9856253d 2001-12-30 alex
62 6725d789 2002-12-12 alex /* Server info text */
63 8adff592 2005-03-19 fw GLOBAL char Conf_ServerInfo[CLIENT_INFO_LEN];
64 9856253d 2001-12-30 alex
65 6725d789 2002-12-12 alex /* Global server passwort */
66 8adff592 2005-03-19 fw GLOBAL char Conf_ServerPwd[CLIENT_PASS_LEN];
67 ed406b4a 2002-01-03 alex
68 6725d789 2002-12-12 alex /* Administrative information */
69 8adff592 2005-03-19 fw GLOBAL char Conf_ServerAdmin1[CLIENT_INFO_LEN];
70 8adff592 2005-03-19 fw GLOBAL char Conf_ServerAdmin2[CLIENT_INFO_LEN];
71 8adff592 2005-03-19 fw GLOBAL char Conf_ServerAdminMail[CLIENT_INFO_LEN];
72 4ded22b0 2002-09-16 alex
73 6725d789 2002-12-12 alex /* File with MOTD text */
74 8adff592 2005-03-19 fw GLOBAL char Conf_MotdFile[FNAME_LEN];
75 03d971d9 2002-01-02 alex
76 7281b8dd 2004-05-07 alex /* Phrase with MOTD text */
77 8adff592 2005-03-19 fw GLOBAL char Conf_MotdPhrase[LINE_LEN];
78 7281b8dd 2004-05-07 alex
79 6725d789 2002-12-12 alex /* Ports the server should listen on */
80 326607ee 2005-03-20 fw GLOBAL UINT16 Conf_ListenPorts[MAX_LISTEN_PORTS];
81 8adff592 2005-03-19 fw GLOBAL int Conf_ListenPorts_Count;
82 03d971d9 2002-01-02 alex
83 e33ab903 2003-09-11 alex /* Address to which the socket should be bound or empty (=all) */
84 8adff592 2005-03-19 fw GLOBAL char Conf_ListenAddress[16];
85 e33ab903 2003-09-11 alex
86 6725d789 2002-12-12 alex /* User and group ID the server should run with */
87 8adff592 2005-03-19 fw GLOBAL unsigned int Conf_UID;
88 8adff592 2005-03-19 fw GLOBAL unsigned int Conf_GID;
89 4cdc9815 2002-03-29 alex
90 7281b8dd 2004-05-07 alex /* A directory to chroot() in */
91 8adff592 2005-03-19 fw GLOBAL char Conf_Chroot[FNAME_LEN];
92 7281b8dd 2004-05-07 alex
93 112102b1 2005-02-04 alex /* File with PID of daemon */
94 8adff592 2005-03-19 fw GLOBAL char Conf_PidFile[FNAME_LEN];
95 112102b1 2005-02-04 alex
96 6725d789 2002-12-12 alex /* Timeouts for PING and PONG */
97 8adff592 2005-03-19 fw GLOBAL int Conf_PingTimeout;
98 8adff592 2005-03-19 fw GLOBAL int Conf_PongTimeout;
99 03d971d9 2002-01-02 alex
100 6725d789 2002-12-12 alex /* Seconds between connect attempts to other servers */
101 8adff592 2005-03-19 fw GLOBAL int Conf_ConnectRetry;
102 03d971d9 2002-01-02 alex
103 6725d789 2002-12-12 alex /* Operators */
104 03d971d9 2002-01-02 alex GLOBAL CONF_OPER Conf_Oper[MAX_OPERATORS];
105 8adff592 2005-03-19 fw GLOBAL int Conf_Oper_Count;
106 03d971d9 2002-01-02 alex
107 6725d789 2002-12-12 alex /* Servers */
108 03d971d9 2002-01-02 alex GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS];
109 03d971d9 2002-01-02 alex
110 6725d789 2002-12-12 alex /* Pre-defined channels */
111 040f5422 2002-05-21 alex GLOBAL CONF_CHANNEL Conf_Channel[MAX_DEFCHANNELS];
112 8adff592 2005-03-19 fw GLOBAL int Conf_Channel_Count;
113 03d971d9 2002-01-02 alex
114 6725d789 2002-12-12 alex /* Are IRC operators allowed to always use MODE? */
115 8adff592 2005-03-19 fw GLOBAL bool Conf_OperCanMode;
116 040f5422 2002-05-21 alex
117 1d08d51e 2005-03-15 alex /* If an IRC op gives chanop privileges without being a chanop,
118 1d08d51e 2005-03-15 alex * ircd2 will ignore the command. This enables a workaround:
119 1d08d51e 2005-03-15 alex * It masks the command as coming from the server */
120 8adff592 2005-03-19 fw GLOBAL bool Conf_OperServerMode;
121 1d08d51e 2005-03-15 alex
122 6725d789 2002-12-12 alex /* Maximum number of connections to this server */
123 8adff592 2005-03-19 fw GLOBAL long Conf_MaxConnections;
124 650f9a2d 2002-11-02 alex
125 8b7b23cf 2002-12-13 alex /* Maximum number of channels a user can join */
126 8adff592 2005-03-19 fw GLOBAL int Conf_MaxJoins;
127 650f9a2d 2002-11-02 alex
128 2981fe9e 2003-11-05 alex /* Maximum number of connections per IP address */
129 8adff592 2005-03-19 fw GLOBAL int Conf_MaxConnectionsIP;
130 8b7b23cf 2002-12-13 alex
131 2981fe9e 2003-11-05 alex
132 8adff592 2005-03-19 fw GLOBAL void Conf_Init PARAMS((void ));
133 8adff592 2005-03-19 fw GLOBAL void Conf_Rehash PARAMS((void ));
134 8adff592 2005-03-19 fw GLOBAL int Conf_Test PARAMS((void ));
135 cbc1e59f 2001-12-12 alex
136 8adff592 2005-03-19 fw GLOBAL void Conf_UnsetServer PARAMS(( CONN_ID Idx ));
137 8adff592 2005-03-19 fw GLOBAL void Conf_SetServer PARAMS(( int ConfServer, CONN_ID Idx ));
138 8adff592 2005-03-19 fw GLOBAL int Conf_GetServer PARAMS(( CONN_ID Idx ));
139 cbc1e59f 2001-12-12 alex
140 8adff592 2005-03-19 fw GLOBAL bool Conf_EnableServer PARAMS(( char *Name, UINT16 Port ));
141 8adff592 2005-03-19 fw GLOBAL bool Conf_DisableServer PARAMS(( char *Name ));
142 8adff592 2005-03-19 fw GLOBAL bool Conf_AddServer PARAMS(( char *Name, UINT16 Port, char *Host, char *MyPwd, char *PeerPwd ));
143 a2544e49 2002-12-30 alex
144 281f7583 2002-12-31 alex
145 cbc1e59f 2001-12-12 alex #endif
146 cbc1e59f 2001-12-12 alex
147 cbc1e59f 2001-12-12 alex
148 cbc1e59f 2001-12-12 alex /* -eof- */