2001-12-12 18:18:20 +01:00
|
|
|
/*
|
|
|
|
* ngIRCd -- The Next Generation IRC Daemon
|
2002-01-02 03:44:36 +01:00
|
|
|
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
|
2001-12-12 18:18:20 +01:00
|
|
|
*
|
2002-12-12 12:26:08 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
* Please read the file COPYING, README and AUTHORS for more information.
|
2001-12-12 18:18:20 +01:00
|
|
|
*
|
2005-03-20 14:54:06 +01:00
|
|
|
* $Id: conf.h,v 1.34 2005/03/20 13:54:06 fw Exp $
|
2001-12-12 18:18:20 +01:00
|
|
|
*
|
2002-12-12 12:26:08 +01:00
|
|
|
* Configuration management (header)
|
2001-12-12 18:18:20 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __conf_h__
|
|
|
|
#define __conf_h__
|
|
|
|
|
2002-01-02 03:44:36 +01:00
|
|
|
#include <time.h>
|
|
|
|
|
2002-03-12 15:37:51 +01:00
|
|
|
#include "defines.h"
|
2005-03-19 19:43:48 +01:00
|
|
|
#include "portab.h"
|
2002-01-02 03:44:36 +01:00
|
|
|
|
|
|
|
typedef struct _Conf_Oper
|
|
|
|
{
|
2005-03-19 19:43:48 +01:00
|
|
|
char name[CLIENT_PASS_LEN]; /* Name (ID) of IRC operator */
|
|
|
|
char pwd[CLIENT_PASS_LEN]; /* Password */
|
2005-03-02 17:07:30 +01:00
|
|
|
char *mask;
|
2002-01-02 03:44:36 +01:00
|
|
|
} CONF_OPER;
|
|
|
|
|
|
|
|
typedef struct _Conf_Server
|
|
|
|
{
|
2005-03-19 19:43:48 +01:00
|
|
|
char host[HOST_LEN]; /* Hostname */
|
|
|
|
char ip[16]; /* IP address (Resolver) */
|
|
|
|
char name[CLIENT_ID_LEN]; /* IRC-Client-ID */
|
|
|
|
char pwd_in[CLIENT_PASS_LEN]; /* Password which must be received */
|
|
|
|
char pwd_out[CLIENT_PASS_LEN]; /* Password to send to peer */
|
|
|
|
UINT16 port; /* Server port */
|
|
|
|
int group; /* Group of server */
|
2002-12-12 12:26:08 +01:00
|
|
|
time_t lasttry; /* Last connect attempt */
|
|
|
|
RES_STAT *res_stat; /* Status of the resolver */
|
2005-03-19 19:43:48 +01:00
|
|
|
int flags; /* Flags */
|
2002-12-30 01:01:42 +01:00
|
|
|
CONN_ID conn_id; /* ID of server connection or NONE */
|
2002-01-02 03:44:36 +01:00
|
|
|
} CONF_SERVER;
|
|
|
|
|
2002-05-21 02:10:16 +02:00
|
|
|
typedef struct _Conf_Channel
|
|
|
|
{
|
2005-03-19 19:43:48 +01:00
|
|
|
char name[CHANNEL_NAME_LEN]; /* Name of the channel */
|
|
|
|
char modes[CHANNEL_MODE_LEN]; /* Initial channel modes */
|
|
|
|
char topic[CHANNEL_TOPIC_LEN]; /* Initial topic */
|
2002-05-21 02:10:16 +02:00
|
|
|
} CONF_CHANNEL;
|
|
|
|
|
2002-01-02 03:44:36 +01:00
|
|
|
|
2002-12-31 17:12:50 +01:00
|
|
|
#define CONF_SFLAG_ONCE 1 /* Delete this entry after next disconnect */
|
|
|
|
#define CONF_SFLAG_DISABLED 2 /* This server configuration entry is disabled */
|
|
|
|
|
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Name ("Nick") of the servers */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_ServerName[CLIENT_ID_LEN];
|
2002-01-02 03:44:36 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Server info text */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_ServerInfo[CLIENT_INFO_LEN];
|
2001-12-12 18:18:20 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Global server passwort */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_ServerPwd[CLIENT_PASS_LEN];
|
2002-01-03 03:27:20 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Administrative information */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_ServerAdmin1[CLIENT_INFO_LEN];
|
|
|
|
GLOBAL char Conf_ServerAdmin2[CLIENT_INFO_LEN];
|
|
|
|
GLOBAL char Conf_ServerAdminMail[CLIENT_INFO_LEN];
|
2002-09-16 11:13:40 +02:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* File with MOTD text */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_MotdFile[FNAME_LEN];
|
2001-12-26 23:48:53 +01:00
|
|
|
|
2004-05-07 13:19:20 +02:00
|
|
|
/* Phrase with MOTD text */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_MotdPhrase[LINE_LEN];
|
2004-05-07 13:19:20 +02:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Ports the server should listen on */
|
2005-03-20 14:54:06 +01:00
|
|
|
GLOBAL UINT16 Conf_ListenPorts[MAX_LISTEN_PORTS];
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL int Conf_ListenPorts_Count;
|
2001-12-26 23:48:53 +01:00
|
|
|
|
2003-09-11 14:05:28 +02:00
|
|
|
/* Address to which the socket should be bound or empty (=all) */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_ListenAddress[16];
|
2003-09-11 14:05:28 +02:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* User and group ID the server should run with */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL unsigned int Conf_UID;
|
|
|
|
GLOBAL unsigned int Conf_GID;
|
2002-03-29 23:53:59 +01:00
|
|
|
|
2004-05-07 13:19:20 +02:00
|
|
|
/* A directory to chroot() in */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_Chroot[FNAME_LEN];
|
2004-05-07 13:19:20 +02:00
|
|
|
|
2005-02-04 15:24:20 +01:00
|
|
|
/* File with PID of daemon */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL char Conf_PidFile[FNAME_LEN];
|
2005-02-04 15:24:20 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Timeouts for PING and PONG */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL int Conf_PingTimeout;
|
|
|
|
GLOBAL int Conf_PongTimeout;
|
2001-12-26 23:48:53 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Seconds between connect attempts to other servers */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL int Conf_ConnectRetry;
|
2001-12-26 23:48:53 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Operators */
|
2002-01-02 03:44:36 +01:00
|
|
|
GLOBAL CONF_OPER Conf_Oper[MAX_OPERATORS];
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL int Conf_Oper_Count;
|
2001-12-31 03:18:51 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Servers */
|
2002-01-02 03:44:36 +01:00
|
|
|
GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS];
|
2001-12-26 04:19:57 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Pre-defined channels */
|
2002-05-21 02:10:16 +02:00
|
|
|
GLOBAL CONF_CHANNEL Conf_Channel[MAX_DEFCHANNELS];
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL int Conf_Channel_Count;
|
2002-05-21 02:10:16 +02:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Are IRC operators allowed to always use MODE? */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL bool Conf_OperCanMode;
|
2001-12-26 04:19:57 +01:00
|
|
|
|
2005-03-15 17:56:16 +01:00
|
|
|
/* If an IRC op gives chanop privileges without being a chanop,
|
|
|
|
* ircd2 will ignore the command. This enables a workaround:
|
|
|
|
* It masks the command as coming from the server */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL bool Conf_OperServerMode;
|
2005-03-15 17:56:16 +01:00
|
|
|
|
2002-12-12 12:26:08 +01:00
|
|
|
/* Maximum number of connections to this server */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL long Conf_MaxConnections;
|
2002-11-02 23:58:41 +01:00
|
|
|
|
2002-12-13 18:32:33 +01:00
|
|
|
/* Maximum number of channels a user can join */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL int Conf_MaxJoins;
|
2002-12-13 18:32:33 +01:00
|
|
|
|
2003-11-05 22:41:01 +01:00
|
|
|
/* Maximum number of connections per IP address */
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL int Conf_MaxConnectionsIP;
|
2003-11-05 22:41:01 +01:00
|
|
|
|
2002-11-02 23:58:41 +01:00
|
|
|
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL void Conf_Init PARAMS((void ));
|
|
|
|
GLOBAL void Conf_Rehash PARAMS((void ));
|
|
|
|
GLOBAL int Conf_Test PARAMS((void ));
|
2001-12-12 18:18:20 +01:00
|
|
|
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL void Conf_UnsetServer PARAMS(( CONN_ID Idx ));
|
|
|
|
GLOBAL void Conf_SetServer PARAMS(( int ConfServer, CONN_ID Idx ));
|
|
|
|
GLOBAL int Conf_GetServer PARAMS(( CONN_ID Idx ));
|
2002-12-30 01:01:42 +01:00
|
|
|
|
2005-03-19 19:43:48 +01:00
|
|
|
GLOBAL bool Conf_EnableServer PARAMS(( char *Name, UINT16 Port ));
|
|
|
|
GLOBAL bool Conf_DisableServer PARAMS(( char *Name ));
|
|
|
|
GLOBAL bool Conf_AddServer PARAMS(( char *Name, UINT16 Port, char *Host, char *MyPwd, char *PeerPwd ));
|
2002-12-31 17:12:50 +01:00
|
|
|
|
2001-12-12 18:18:20 +01:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* -eof- */
|