2005-04-16 14:49:58 +00:00
|
|
|
#ifndef _TASKIBC_H
|
|
|
|
#define _TASKIBC_H
|
2005-04-15 21:36:44 +00:00
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2006-05-25 19:17:49 +00:00
|
|
|
#define MAXIBC_NCS 50 /* Maximum Neighbour ChatServers */
|
|
|
|
#define MAXIBC_SRV 200 /* Maximum Servers in chatnetwork */
|
|
|
|
#define MAXIBC_USR 500 /* Maximum Users in chatnetwork */
|
|
|
|
#define MAXIBC_CHN 200 /* Maximum Channels in chatnetwork */
|
|
|
|
|
2006-05-25 16:37:52 +00:00
|
|
|
|
2005-04-17 10:32:41 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Linked list of neighbour chatservers
|
|
|
|
*/
|
2006-05-25 16:37:52 +00:00
|
|
|
typedef struct _ncs_rec {
|
2005-04-17 10:32:41 +00:00
|
|
|
char server[64]; /* Server address */
|
2005-11-15 22:05:15 +00:00
|
|
|
char resolved[64]; /* Resolved server address */
|
2005-04-17 12:08:59 +00:00
|
|
|
char myname[64]; /* My server address */
|
2005-04-17 10:32:41 +00:00
|
|
|
char passwd[16]; /* Server password */
|
|
|
|
int state; /* Connection state */
|
|
|
|
time_t action; /* Time for next action */
|
|
|
|
time_t last; /* Last received message */
|
|
|
|
int version; /* Protocol version of peer */
|
|
|
|
unsigned remove : 1; /* If entry must be removed */
|
|
|
|
unsigned compress : 1; /* User link compression */
|
2005-04-17 14:14:56 +00:00
|
|
|
unsigned gotpass : 1; /* Received valid password */
|
|
|
|
unsigned gotserver : 1; /* Received valid server */
|
2005-11-15 22:05:15 +00:00
|
|
|
unsigned dyndns : 1; /* Is a dynamic dns remote */
|
2005-04-17 10:32:41 +00:00
|
|
|
struct sockaddr_in servaddr_in; /* Peer socketaddress */
|
|
|
|
int socket; /* Peer socket */
|
2005-10-11 20:49:41 +00:00
|
|
|
unsigned int token; /* Server token */
|
2005-12-07 20:23:51 +00:00
|
|
|
int halfdead; /* Halfdead connect count */
|
2005-12-17 16:35:10 +00:00
|
|
|
unsigned int crc; /* CRC value of record */
|
2006-05-25 16:37:52 +00:00
|
|
|
} _ncs_list;
|
|
|
|
|
|
|
|
_ncs_list ncs_list[MAXIBC_NCS];
|
2005-04-17 10:32:41 +00:00
|
|
|
|
|
|
|
|
2005-04-18 12:56:28 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Database with servers
|
|
|
|
*/
|
2006-05-25 16:37:52 +00:00
|
|
|
typedef struct _srv_rec {
|
2005-04-18 12:56:28 +00:00
|
|
|
char server[64]; /* FQDN of the server */
|
2005-04-18 18:36:27 +00:00
|
|
|
char router[64]; /* Route to this server */
|
2005-04-18 14:28:41 +00:00
|
|
|
int hops; /* Howmany hops away */
|
2005-04-18 12:56:28 +00:00
|
|
|
time_t connected; /* Connection time */
|
2005-04-18 15:19:39 +00:00
|
|
|
char prod[21]; /* Product name */
|
|
|
|
char vers[21]; /* Version string */
|
2005-04-20 16:59:32 +00:00
|
|
|
char fullname[37]; /* Full BBS name */
|
2005-04-18 12:56:28 +00:00
|
|
|
int users; /* Users in chat */
|
2006-05-25 16:37:52 +00:00
|
|
|
} _srv_list;
|
|
|
|
|
|
|
|
_srv_list srv_list[MAXIBC_SRV];
|
2005-04-18 12:56:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Database with users
|
|
|
|
*/
|
2006-05-25 16:37:52 +00:00
|
|
|
typedef struct _usr_rec {
|
2005-04-18 12:56:28 +00:00
|
|
|
char server[64]; /* FQDN of users server */
|
2005-04-22 18:39:48 +00:00
|
|
|
char name[10]; /* Users unix name */
|
|
|
|
char nick[10]; /* Users nick name */
|
2005-04-20 16:59:32 +00:00
|
|
|
char realname[37]; /* Users real name */
|
2005-04-18 12:56:28 +00:00
|
|
|
char channel[21]; /* Users channel */
|
|
|
|
time_t connected; /* Users connect time */
|
2005-05-01 12:27:27 +00:00
|
|
|
unsigned sysop : 1; /* User is a sysop */
|
|
|
|
pid_t pid; /* Users pid if local */
|
|
|
|
int pointer; /* Users message pointer */
|
2006-05-25 16:37:52 +00:00
|
|
|
} _usr_list;
|
|
|
|
|
|
|
|
_usr_list usr_list[MAXIBC_USR];
|
2005-04-18 12:56:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Database with channels
|
|
|
|
*/
|
2006-05-25 16:37:52 +00:00
|
|
|
typedef struct _chn_rec {
|
2005-04-18 12:56:28 +00:00
|
|
|
char server[64]; /* Originating server */
|
|
|
|
char name[21]; /* Channel name */
|
|
|
|
char topic[55]; /* Channel topic */
|
2005-04-20 16:59:32 +00:00
|
|
|
char owner[10]; /* Channel owner */
|
2005-04-18 12:56:28 +00:00
|
|
|
time_t created; /* Channel created */
|
2005-04-27 19:52:51 +00:00
|
|
|
time_t lastmsg; /* Last message in channel */
|
2005-04-18 12:56:28 +00:00
|
|
|
int users; /* Users in channel */
|
2006-05-25 16:37:52 +00:00
|
|
|
} _chn_list;
|
|
|
|
|
|
|
|
_chn_list chn_list[MAXIBC_CHN];
|
2005-04-18 12:56:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2005-05-01 13:12:41 +00:00
|
|
|
/*
|
2006-05-25 19:17:49 +00:00
|
|
|
* Database with banned users (not yet in use)
|
2005-05-01 13:12:41 +00:00
|
|
|
*/
|
2006-05-25 19:17:49 +00:00
|
|
|
//typedef struct _ban_rec {
|
|
|
|
// char server[64]; /* Users server */
|
|
|
|
// char name[10]; /* Users name */
|
|
|
|
// char channel[21]; /* Users banned channel */
|
|
|
|
// time_t kicked; /* Users banned time */
|
|
|
|
//} _ban_list;
|
2005-05-01 13:12:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2006-05-25 19:17:49 +00:00
|
|
|
* Database with nicknames (not yet in use)
|
2005-05-01 13:12:41 +00:00
|
|
|
*/
|
2006-05-25 19:17:49 +00:00
|
|
|
//typedef struct _nick_rec {
|
|
|
|
// char server[64]; /* Originating server */
|
|
|
|
// char nick[10]; /* Nickname */
|
|
|
|
// time_t lastused; /* Last used time */
|
|
|
|
//} _nick_list;
|
|
|
|
|
|
|
|
|
2005-05-01 13:12:41 +00:00
|
|
|
|
|
|
|
|
2006-05-25 16:37:52 +00:00
|
|
|
int add_user(char *, char *, char *);
|
|
|
|
void del_user(char *, char *);
|
|
|
|
int add_channel(char *, char *, char *);
|
|
|
|
void del_channel(char *);
|
2005-04-27 18:02:30 +00:00
|
|
|
int do_command(char *, char *, char *);
|
2005-04-20 16:59:32 +00:00
|
|
|
|
2006-03-06 16:34:26 +00:00
|
|
|
void send_all(char *);
|
2006-01-25 19:50:36 +00:00
|
|
|
void send_at(char *, char *, char *);
|
|
|
|
void send_nick(char *, char *, char *);
|
2006-02-13 19:26:30 +00:00
|
|
|
void check_servers(void);
|
|
|
|
void ibc_receiver(char *);
|
2006-05-25 16:37:52 +00:00
|
|
|
void ibc_init(void);
|
2006-02-13 19:26:30 +00:00
|
|
|
void ibc_shutdown(void);
|
|
|
|
|
2005-04-17 10:32:41 +00:00
|
|
|
|
2005-04-15 21:36:44 +00:00
|
|
|
#endif
|