2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
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.
18 * Configuration management (header)
27 #include "ng_ipaddr.h"
33 char name[CLIENT_PASS_LEN]; /* Name (ID) of IRC operator */
34 char pwd[CLIENT_PASS_LEN]; /* Password */
35 char *mask; /* allowed host mask */
38 typedef struct _Conf_Server
40 char host[HOST_LEN]; /* Hostname */
41 char name[CLIENT_ID_LEN]; /* IRC-Client-ID */
42 char pwd_in[CLIENT_PASS_LEN]; /* Password which must be received */
43 char pwd_out[CLIENT_PASS_LEN]; /* Password to send to peer */
44 UINT16 port; /* Server port */
45 int group; /* Group of server */
46 time_t lasttry; /* Last connect attempt */
47 PROC_STAT res_stat; /* Status of the resolver */
48 int flags; /* Flags */
49 CONN_ID conn_id; /* ID of server connection or NONE */
50 ng_ipaddr_t bind_addr; /* source address to use for outgoing
52 ng_ipaddr_t dst_addr[2]; /* list of addresses to connect to */
54 bool SSLConnect; /* connect() using SSL? */
56 char svs_mask[CLIENT_ID_LEN]; /* Mask of nick names that are
67 array KeyFilePassword;
73 char name[CHANNEL_NAME_LEN]; /* Name of the channel */
74 char modes[CHANNEL_MODE_LEN]; /* Initial channel modes */
75 char key[CLIENT_PASS_LEN]; /* Channel key ("password", mode "k" ) */
76 char topic[COMMAND_LEN]; /* Initial topic */
77 char keyfile[512]; /* Path and name of channel key file */
78 unsigned long maxusers; /* maximum usercount for this channel, mode "l" */
82 #define CONF_SFLAG_ONCE 1 /* Delete this entry after next disconnect */
83 #define CONF_SFLAG_DISABLED 2 /* This server configuration entry is disabled */
86 /* Name ("Nick") of the servers */
87 GLOBAL char Conf_ServerName[CLIENT_ID_LEN];
89 /* Server info text */
90 GLOBAL char Conf_ServerInfo[CLIENT_INFO_LEN];
92 /* Global server passwort */
93 GLOBAL char Conf_ServerPwd[CLIENT_PASS_LEN];
95 /* Administrative information */
96 GLOBAL char Conf_ServerAdmin1[CLIENT_INFO_LEN];
97 GLOBAL char Conf_ServerAdmin2[CLIENT_INFO_LEN];
98 GLOBAL char Conf_ServerAdminMail[CLIENT_INFO_LEN];
100 /* Message of the Day */
101 GLOBAL array Conf_Motd;
103 /* Ports the server should listen on */
104 GLOBAL array Conf_ListenPorts;
106 /* Address to which the socket should be bound or empty (=all) */
107 GLOBAL char *Conf_ListenAddress;
109 /* User and group ID the server should run with */
110 GLOBAL uid_t Conf_UID;
111 GLOBAL gid_t Conf_GID;
113 /* A directory to chroot() in */
114 GLOBAL char Conf_Chroot[FNAME_LEN];
116 /* File with PID of daemon */
117 GLOBAL char Conf_PidFile[FNAME_LEN];
119 /* Timeouts for PING and PONG */
120 GLOBAL int Conf_PingTimeout;
121 GLOBAL int Conf_PongTimeout;
123 /* Seconds between connect attempts to other servers */
124 GLOBAL int Conf_ConnectRetry;
127 GLOBAL array Conf_Opers;
130 GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS];
132 /* Pre-defined channels */
133 GLOBAL array Conf_Channels;
135 /* Pre-defined channels only */
136 GLOBAL bool Conf_PredefChannelsOnly;
138 /* Are IRC operators allowed to always use MODE? */
139 GLOBAL bool Conf_OperCanMode;
141 /* If an IRC op gives chanop privileges without being a chanop,
142 * ircd2 will ignore the command. This enables a workaround:
143 * It masks the command as coming from the server */
144 GLOBAL bool Conf_OperServerMode;
146 /* Are remote IRC operators allowed to manage this server? */
147 GLOBAL bool Conf_AllowRemoteOper;
149 /* Enable all DNS functions? */
150 GLOBAL bool Conf_DNS;
152 /* Enable IDENT lookups, even when compiled with support for it */
153 GLOBAL bool Conf_Ident;
155 /* Enable all usage of PAM, even when compiled with support for it */
156 GLOBAL bool Conf_PAM;
159 * try to connect to remote systems using the ipv6 protocol,
160 * if they have an ipv6 address? (default yes)
162 GLOBAL bool Conf_ConnectIPv6;
164 /* same as above, but for ipv4 hosts, default: yes */
165 GLOBAL bool Conf_ConnectIPv4;
167 /* Maximum number of connections to this server */
168 GLOBAL long Conf_MaxConnections;
170 /* Maximum number of channels a user can join */
171 GLOBAL int Conf_MaxJoins;
173 /* Maximum number of connections per IP address */
174 GLOBAL int Conf_MaxConnectionsIP;
176 /* Maximum length of a nick name */
177 GLOBAL unsigned int Conf_MaxNickLength;
181 /* Syslog "facility" */
182 GLOBAL int Conf_SyslogFacility;
186 GLOBAL void Conf_Init PARAMS((void));
187 GLOBAL bool Conf_Rehash PARAMS((void));
188 GLOBAL int Conf_Test PARAMS((void));
190 GLOBAL void Conf_UnsetServer PARAMS(( CONN_ID Idx ));
191 GLOBAL void Conf_SetServer PARAMS(( int ConfServer, CONN_ID Idx ));
192 GLOBAL int Conf_GetServer PARAMS(( CONN_ID Idx ));
194 GLOBAL bool Conf_EnableServer PARAMS(( const char *Name, UINT16 Port ));
195 GLOBAL bool Conf_EnablePassiveServer PARAMS((const char *Name));
196 GLOBAL bool Conf_DisableServer PARAMS(( const char *Name ));
197 GLOBAL bool Conf_AddServer PARAMS(( const char *Name, UINT16 Port, const char *Host, const char *MyPwd, const char *PeerPwd ));
199 GLOBAL bool Conf_IsService PARAMS((int ConfServer, const char *Nick));
201 /* Password required by WEBIRC command */
202 GLOBAL char Conf_WebircPwd[CLIENT_PASS_LEN];
205 GLOBAL void Conf_DebugDump PARAMS((void));