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 281f7583 2002-12-31 alex * $Id: conf.h,v 1.26 2002/12/31 16:12:50 alex 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 574ae82c 2001-12-26 alex
24 ff54198f 2002-02-27 alex
25 03d971d9 2002-01-02 alex typedef struct _Conf_Oper
26 03d971d9 2002-01-02 alex {
27 6725d789 2002-12-12 alex CHAR name[CLIENT_PASS_LEN]; /* Name (ID) of IRC operator */
28 6725d789 2002-12-12 alex CHAR pwd[CLIENT_PASS_LEN]; /* Password */
29 03d971d9 2002-01-02 alex } CONF_OPER;
30 574ae82c 2001-12-26 alex
31 03d971d9 2002-01-02 alex typedef struct _Conf_Server
32 03d971d9 2002-01-02 alex {
33 d67d94ea 2002-03-10 alex CHAR host[HOST_LEN]; /* Hostname */
34 6725d789 2002-12-12 alex CHAR ip[16]; /* IP address (Resolver) */
35 d67d94ea 2002-03-10 alex CHAR name[CLIENT_ID_LEN]; /* IRC-Client-ID */
36 6725d789 2002-12-12 alex CHAR pwd_in[CLIENT_PASS_LEN]; /* Password which must be received */
37 6725d789 2002-12-12 alex CHAR pwd_out[CLIENT_PASS_LEN]; /* Password to send to peer */
38 6725d789 2002-12-12 alex INT port; /* Server port */
39 6725d789 2002-12-12 alex INT group; /* Group of server */
40 6725d789 2002-12-12 alex time_t lasttry; /* Last connect attempt */
41 6725d789 2002-12-12 alex RES_STAT *res_stat; /* Status of the resolver */
42 281f7583 2002-12-31 alex INT flags; /* Flags */
43 a2544e49 2002-12-30 alex CONN_ID conn_id; /* ID of server connection or NONE */
44 03d971d9 2002-01-02 alex } CONF_SERVER;
45 574ae82c 2001-12-26 alex
46 040f5422 2002-05-21 alex typedef struct _Conf_Channel
47 040f5422 2002-05-21 alex {
48 6725d789 2002-12-12 alex CHAR name[CHANNEL_NAME_LEN]; /* Name of the channel */
49 6725d789 2002-12-12 alex CHAR modes[CHANNEL_MODE_LEN]; /* Initial channel modes */
50 6725d789 2002-12-12 alex CHAR topic[CHANNEL_TOPIC_LEN]; /* Initial topic */
51 040f5422 2002-05-21 alex } CONF_CHANNEL;
52 574ae82c 2001-12-26 alex
53 040f5422 2002-05-21 alex
54 281f7583 2002-12-31 alex #define CONF_SFLAG_ONCE 1 /* Delete this entry after next disconnect */
55 281f7583 2002-12-31 alex #define CONF_SFLAG_DISABLED 2 /* This server configuration entry is disabled */
56 281f7583 2002-12-31 alex
57 281f7583 2002-12-31 alex
58 6725d789 2002-12-12 alex /* Name ("Nick") of the servers */
59 03d971d9 2002-01-02 alex GLOBAL CHAR Conf_ServerName[CLIENT_ID_LEN];
60 9856253d 2001-12-30 alex
61 6725d789 2002-12-12 alex /* Server info text */
62 03d971d9 2002-01-02 alex GLOBAL CHAR Conf_ServerInfo[CLIENT_INFO_LEN];
63 9856253d 2001-12-30 alex
64 6725d789 2002-12-12 alex /* Global server passwort */
65 ed406b4a 2002-01-03 alex GLOBAL CHAR Conf_ServerPwd[CLIENT_PASS_LEN];
66 ed406b4a 2002-01-03 alex
67 6725d789 2002-12-12 alex /* Administrative information */
68 4ded22b0 2002-09-16 alex GLOBAL CHAR Conf_ServerAdmin1[CLIENT_INFO_LEN];
69 4ded22b0 2002-09-16 alex GLOBAL CHAR Conf_ServerAdmin2[CLIENT_INFO_LEN];
70 4ded22b0 2002-09-16 alex GLOBAL CHAR Conf_ServerAdminMail[CLIENT_INFO_LEN];
71 4ded22b0 2002-09-16 alex
72 6725d789 2002-12-12 alex /* File with MOTD text */
73 03d971d9 2002-01-02 alex GLOBAL CHAR Conf_MotdFile[FNAME_LEN];
74 03d971d9 2002-01-02 alex
75 6725d789 2002-12-12 alex /* Ports the server should listen on */
76 4cdc9815 2002-03-29 alex GLOBAL UINT Conf_ListenPorts[MAX_LISTEN_PORTS];
77 03d971d9 2002-01-02 alex GLOBAL INT Conf_ListenPorts_Count;
78 03d971d9 2002-01-02 alex
79 6725d789 2002-12-12 alex /* User and group ID the server should run with */
80 4cdc9815 2002-03-29 alex GLOBAL UINT Conf_UID;
81 4cdc9815 2002-03-29 alex GLOBAL UINT Conf_GID;
82 4cdc9815 2002-03-29 alex
83 6725d789 2002-12-12 alex /* Timeouts for PING and PONG */
84 03d971d9 2002-01-02 alex GLOBAL INT Conf_PingTimeout;
85 03d971d9 2002-01-02 alex GLOBAL INT Conf_PongTimeout;
86 03d971d9 2002-01-02 alex
87 6725d789 2002-12-12 alex /* Seconds between connect attempts to other servers */
88 03d971d9 2002-01-02 alex GLOBAL INT Conf_ConnectRetry;
89 03d971d9 2002-01-02 alex
90 6725d789 2002-12-12 alex /* Operators */
91 03d971d9 2002-01-02 alex GLOBAL CONF_OPER Conf_Oper[MAX_OPERATORS];
92 03d971d9 2002-01-02 alex GLOBAL INT Conf_Oper_Count;
93 03d971d9 2002-01-02 alex
94 6725d789 2002-12-12 alex /* Servers */
95 03d971d9 2002-01-02 alex GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS];
96 03d971d9 2002-01-02 alex
97 6725d789 2002-12-12 alex /* Pre-defined channels */
98 040f5422 2002-05-21 alex GLOBAL CONF_CHANNEL Conf_Channel[MAX_DEFCHANNELS];
99 040f5422 2002-05-21 alex GLOBAL INT Conf_Channel_Count;
100 03d971d9 2002-01-02 alex
101 6725d789 2002-12-12 alex /* Are IRC operators allowed to always use MODE? */
102 7e1b3b91 2002-09-02 alex GLOBAL BOOLEAN Conf_OperCanMode;
103 040f5422 2002-05-21 alex
104 6725d789 2002-12-12 alex /* Maximum number of connections to this server */
105 650f9a2d 2002-11-02 alex GLOBAL LONG Conf_MaxConnections;
106 650f9a2d 2002-11-02 alex
107 8b7b23cf 2002-12-13 alex /* Maximum number of channels a user can join */
108 8b7b23cf 2002-12-13 alex GLOBAL INT Conf_MaxJoins;
109 650f9a2d 2002-11-02 alex
110 8b7b23cf 2002-12-13 alex
111 c2f60abe 2002-05-27 alex GLOBAL VOID Conf_Init PARAMS((VOID ));
112 a2544e49 2002-12-30 alex GLOBAL VOID Conf_Rehash PARAMS((VOID ));
113 c2f60abe 2002-05-27 alex GLOBAL INT Conf_Test PARAMS((VOID ));
114 cbc1e59f 2001-12-12 alex
115 a2544e49 2002-12-30 alex GLOBAL VOID Conf_UnsetServer PARAMS(( CONN_ID Idx ));
116 a2544e49 2002-12-30 alex GLOBAL VOID Conf_SetServer PARAMS(( INT ConfServer, CONN_ID Idx ));
117 a2544e49 2002-12-30 alex GLOBAL INT Conf_GetServer PARAMS(( CONN_ID Idx ));
118 cbc1e59f 2001-12-12 alex
119 281f7583 2002-12-31 alex GLOBAL BOOLEAN Conf_EnableServer PARAMS(( CHAR *Name, INT Port ));
120 281f7583 2002-12-31 alex GLOBAL BOOLEAN Conf_DisableServer PARAMS(( CHAR *Name ));
121 281f7583 2002-12-31 alex GLOBAL BOOLEAN Conf_AddServer PARAMS(( CHAR *Name, INT Port, CHAR *Host, CHAR *MyPwd, CHAR *PeerPwd ));
122 a2544e49 2002-12-30 alex
123 281f7583 2002-12-31 alex
124 cbc1e59f 2001-12-12 alex #endif
125 cbc1e59f 2001-12-12 alex
126 cbc1e59f 2001-12-12 alex
127 cbc1e59f 2001-12-12 alex /* -eof- */