Blob


1 /*
2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * Please read the file COPYING, README and AUTHORS for more information.
10 *
11 * $Id: conf.h,v 1.29 2004/05/07 11:19:21 alex Exp $
12 *
13 * Configuration management (header)
14 */
17 #ifndef __conf_h__
18 #define __conf_h__
20 #include <time.h>
22 #include "defines.h"
25 typedef struct _Conf_Oper
26 {
27 CHAR name[CLIENT_PASS_LEN]; /* Name (ID) of IRC operator */
28 CHAR pwd[CLIENT_PASS_LEN]; /* Password */
29 } CONF_OPER;
31 typedef struct _Conf_Server
32 {
33 CHAR host[HOST_LEN]; /* Hostname */
34 CHAR ip[16]; /* IP address (Resolver) */
35 CHAR name[CLIENT_ID_LEN]; /* IRC-Client-ID */
36 CHAR pwd_in[CLIENT_PASS_LEN]; /* Password which must be received */
37 CHAR pwd_out[CLIENT_PASS_LEN]; /* Password to send to peer */
38 INT port; /* Server port */
39 INT group; /* Group of server */
40 time_t lasttry; /* Last connect attempt */
41 RES_STAT *res_stat; /* Status of the resolver */
42 INT flags; /* Flags */
43 CONN_ID conn_id; /* ID of server connection or NONE */
44 } CONF_SERVER;
46 typedef struct _Conf_Channel
47 {
48 CHAR name[CHANNEL_NAME_LEN]; /* Name of the channel */
49 CHAR modes[CHANNEL_MODE_LEN]; /* Initial channel modes */
50 CHAR topic[CHANNEL_TOPIC_LEN]; /* Initial topic */
51 } CONF_CHANNEL;
54 #define CONF_SFLAG_ONCE 1 /* Delete this entry after next disconnect */
55 #define CONF_SFLAG_DISABLED 2 /* This server configuration entry is disabled */
58 /* Name ("Nick") of the servers */
59 GLOBAL CHAR Conf_ServerName[CLIENT_ID_LEN];
61 /* Server info text */
62 GLOBAL CHAR Conf_ServerInfo[CLIENT_INFO_LEN];
64 /* Global server passwort */
65 GLOBAL CHAR Conf_ServerPwd[CLIENT_PASS_LEN];
67 /* Administrative information */
68 GLOBAL CHAR Conf_ServerAdmin1[CLIENT_INFO_LEN];
69 GLOBAL CHAR Conf_ServerAdmin2[CLIENT_INFO_LEN];
70 GLOBAL CHAR Conf_ServerAdminMail[CLIENT_INFO_LEN];
72 /* File with MOTD text */
73 GLOBAL CHAR Conf_MotdFile[FNAME_LEN];
75 /* Phrase with MOTD text */
76 GLOBAL CHAR Conf_MotdPhrase[LINE_LEN];
78 /* Ports the server should listen on */
79 GLOBAL UINT Conf_ListenPorts[MAX_LISTEN_PORTS];
80 GLOBAL INT Conf_ListenPorts_Count;
82 /* Address to which the socket should be bound or empty (=all) */
83 GLOBAL CHAR Conf_ListenAddress[16];
85 /* User and group ID the server should run with */
86 GLOBAL UINT Conf_UID;
87 GLOBAL UINT Conf_GID;
89 /* A directory to chroot() in */
90 GLOBAL CHAR Conf_Chroot[FNAME_LEN];
92 /* Timeouts for PING and PONG */
93 GLOBAL INT Conf_PingTimeout;
94 GLOBAL INT Conf_PongTimeout;
96 /* Seconds between connect attempts to other servers */
97 GLOBAL INT Conf_ConnectRetry;
99 /* Operators */
100 GLOBAL CONF_OPER Conf_Oper[MAX_OPERATORS];
101 GLOBAL INT Conf_Oper_Count;
103 /* Servers */
104 GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS];
106 /* Pre-defined channels */
107 GLOBAL CONF_CHANNEL Conf_Channel[MAX_DEFCHANNELS];
108 GLOBAL INT Conf_Channel_Count;
110 /* Are IRC operators allowed to always use MODE? */
111 GLOBAL BOOLEAN Conf_OperCanMode;
113 /* Maximum number of connections to this server */
114 GLOBAL LONG Conf_MaxConnections;
116 /* Maximum number of channels a user can join */
117 GLOBAL INT Conf_MaxJoins;
119 /* Maximum number of connections per IP address */
120 GLOBAL INT Conf_MaxConnectionsIP;
123 GLOBAL VOID Conf_Init PARAMS((VOID ));
124 GLOBAL VOID Conf_Rehash PARAMS((VOID ));
125 GLOBAL INT Conf_Test PARAMS((VOID ));
127 GLOBAL VOID Conf_UnsetServer PARAMS(( CONN_ID Idx ));
128 GLOBAL VOID Conf_SetServer PARAMS(( INT ConfServer, CONN_ID Idx ));
129 GLOBAL INT Conf_GetServer PARAMS(( CONN_ID Idx ));
131 GLOBAL BOOLEAN Conf_EnableServer PARAMS(( CHAR *Name, INT Port ));
132 GLOBAL BOOLEAN Conf_DisableServer PARAMS(( CHAR *Name ));
133 GLOBAL BOOLEAN Conf_AddServer PARAMS(( CHAR *Name, INT Port, CHAR *Host, CHAR *MyPwd, CHAR *PeerPwd ));
136 #endif
139 /* -eof- */