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