]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/conf.h
topic no longer limited to 127 chars (now only limited by protocol)
[ngircd-alex.git] / src / ngircd / conf.h
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.36 2005/07/28 16:23:55 fw Exp $
12  *
13  * Configuration management (header)
14  */
15
16
17 #ifndef __conf_h__
18 #define __conf_h__
19
20 #include <time.h>
21
22 #include "defines.h"
23 #include "array.h"
24 #include "portab.h"
25
26 typedef struct _Conf_Oper
27 {
28         char name[CLIENT_PASS_LEN];     /* Name (ID) of IRC operator */
29         char pwd[CLIENT_PASS_LEN];      /* Password */
30         char *mask;
31 } CONF_OPER;
32
33 typedef struct _Conf_Server
34 {
35         char host[HOST_LEN];            /* Hostname */
36         char ip[16];                    /* IP address (Resolver) */
37         char name[CLIENT_ID_LEN];       /* IRC-Client-ID */
38         char pwd_in[CLIENT_PASS_LEN];   /* Password which must be received */
39         char pwd_out[CLIENT_PASS_LEN];  /* Password to send to peer */
40         UINT16 port;                    /* Server port */
41         int group;                      /* Group of server */
42         time_t lasttry;                 /* Last connect attempt */
43         RES_STAT *res_stat;             /* Status of the resolver */
44         int flags;                      /* Flags */
45         CONN_ID conn_id;                /* ID of server connection or NONE */
46 } CONF_SERVER;
47
48 typedef struct _Conf_Channel
49 {
50         char name[CHANNEL_NAME_LEN];    /* Name of the channel */
51         char modes[CHANNEL_MODE_LEN];   /* Initial channel modes */
52         array topic;                    /* Initial topic */
53 } CONF_CHANNEL;
54
55
56 #define CONF_SFLAG_ONCE 1               /* Delete this entry after next disconnect */
57 #define CONF_SFLAG_DISABLED 2           /* This server configuration entry is disabled */
58
59
60 /* Name ("Nick") of the servers */
61 GLOBAL char Conf_ServerName[CLIENT_ID_LEN];
62
63 /* Server info text */
64 GLOBAL char Conf_ServerInfo[CLIENT_INFO_LEN];
65
66 /* Global server passwort */
67 GLOBAL char Conf_ServerPwd[CLIENT_PASS_LEN];
68
69 /* Administrative information */
70 GLOBAL char Conf_ServerAdmin1[CLIENT_INFO_LEN];
71 GLOBAL char Conf_ServerAdmin2[CLIENT_INFO_LEN];
72 GLOBAL char Conf_ServerAdminMail[CLIENT_INFO_LEN];
73
74 /* File with MOTD text */
75 GLOBAL char Conf_MotdFile[FNAME_LEN];
76
77 /* Phrase with MOTD text */
78 GLOBAL char Conf_MotdPhrase[LINE_LEN];
79
80 /* Ports the server should listen on */
81 GLOBAL UINT16 Conf_ListenPorts[MAX_LISTEN_PORTS];
82 GLOBAL unsigned int Conf_ListenPorts_Count;
83
84 /* Address to which the socket should be bound or empty (=all) */
85 GLOBAL char Conf_ListenAddress[16];
86
87 /* User and group ID the server should run with */
88 GLOBAL unsigned int Conf_UID;
89 GLOBAL unsigned int Conf_GID;
90
91 /* A directory to chroot() in */
92 GLOBAL char Conf_Chroot[FNAME_LEN];
93
94 /* File with PID of daemon */
95 GLOBAL char Conf_PidFile[FNAME_LEN];
96
97 /* Timeouts for PING and PONG */
98 GLOBAL int Conf_PingTimeout;
99 GLOBAL int Conf_PongTimeout;
100
101 /* Seconds between connect attempts to other servers */
102 GLOBAL int Conf_ConnectRetry;
103
104 /* Operators */
105 GLOBAL CONF_OPER Conf_Oper[MAX_OPERATORS];
106 GLOBAL unsigned int Conf_Oper_Count;
107
108 /* Servers */
109 GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS];
110
111 /* Pre-defined channels */
112 GLOBAL CONF_CHANNEL Conf_Channel[MAX_DEFCHANNELS];
113 GLOBAL unsigned int Conf_Channel_Count;
114
115 /* Are IRC operators allowed to always use MODE? */
116 GLOBAL bool Conf_OperCanMode;
117
118 /* If an IRC op gives chanop privileges without being a chanop,
119  * ircd2 will ignore the command. This enables a workaround:
120  * It masks the command as coming from the server */
121 GLOBAL bool Conf_OperServerMode;
122
123 /* Maximum number of connections to this server */
124 GLOBAL long Conf_MaxConnections;
125
126 /* Maximum number of channels a user can join */
127 GLOBAL int Conf_MaxJoins;
128
129 /* Maximum number of connections per IP address */
130 GLOBAL int Conf_MaxConnectionsIP;
131
132
133 GLOBAL void Conf_Init PARAMS((void ));
134 GLOBAL void Conf_Rehash PARAMS((void ));
135 GLOBAL int Conf_Test PARAMS((void ));
136
137 GLOBAL void Conf_UnsetServer PARAMS(( CONN_ID Idx ));
138 GLOBAL void Conf_SetServer PARAMS(( int ConfServer, CONN_ID Idx ));
139 GLOBAL int Conf_GetServer PARAMS(( CONN_ID Idx ));
140
141 GLOBAL bool Conf_EnableServer PARAMS(( char *Name, UINT16 Port ));
142 GLOBAL bool Conf_DisableServer PARAMS(( char *Name ));
143 GLOBAL bool Conf_AddServer PARAMS(( char *Name, UINT16 Port, char *Host, char *MyPwd, char *PeerPwd ));
144
145
146 #endif
147
148
149 /* -eof- */