2000-08-26 11:39:44 -04:00
|
|
|
#ifndef __SERVERS_SETUP_H
|
|
|
|
#define __SERVERS_SETUP_H
|
|
|
|
|
2001-01-01 02:45:54 -05:00
|
|
|
#include "modules.h"
|
2000-08-26 11:39:44 -04:00
|
|
|
|
|
|
|
#define SERVER_SETUP(server) \
|
2000-08-30 18:29:55 -04:00
|
|
|
MODULE_CHECK_CAST(server, SERVER_SETUP_REC, type, "SERVER SETUP")
|
|
|
|
|
|
|
|
#define IS_SERVER_SETUP(server) \
|
|
|
|
(SERVER_SETUP(server) ? TRUE : FALSE)
|
2000-08-26 11:39:44 -04:00
|
|
|
|
|
|
|
/* servers */
|
2001-01-01 02:45:54 -05:00
|
|
|
struct _SERVER_SETUP_REC {
|
2000-08-26 11:39:44 -04:00
|
|
|
#include "server-setup-rec.h"
|
2001-01-01 02:45:54 -05:00
|
|
|
};
|
2000-08-26 11:39:44 -04:00
|
|
|
|
|
|
|
extern GSList *setupservers;
|
|
|
|
|
2001-03-03 20:47:13 -05:00
|
|
|
extern IPADDR *source_host_ip4, *source_host_ip6; /* Resolved address */
|
2000-08-26 11:39:44 -04:00
|
|
|
extern int source_host_ok; /* Use source_host_ip .. */
|
|
|
|
|
|
|
|
/* Fill reconnection specific information to connection
|
|
|
|
from server setup record */
|
|
|
|
void server_setup_fill_reconn(SERVER_CONNECT_REC *conn,
|
|
|
|
SERVER_SETUP_REC *sserver);
|
|
|
|
|
|
|
|
/* Create server connection record. `dest' is required, rest can be NULL.
|
|
|
|
`dest' is either a server address or chat network */
|
|
|
|
SERVER_CONNECT_REC *
|
2001-02-17 14:44:22 -05:00
|
|
|
server_create_conn(int chat_type, const char *dest, int port,
|
2001-03-07 19:24:27 -05:00
|
|
|
const char *chatnet, const char *password,
|
|
|
|
const char *nick);
|
2000-08-26 11:39:44 -04:00
|
|
|
|
|
|
|
/* Find matching server from setup. Try to find record with a same port,
|
|
|
|
but fallback to any server with the same address. */
|
2001-06-27 17:47:31 -04:00
|
|
|
SERVER_SETUP_REC *server_setup_find(const char *address, int port,
|
|
|
|
const char *chatnet);
|
2000-08-26 11:39:44 -04:00
|
|
|
/* Find matching server from setup. Ports must match or NULL is returned. */
|
|
|
|
SERVER_SETUP_REC *server_setup_find_port(const char *address, int port);
|
|
|
|
|
|
|
|
void server_setup_add(SERVER_SETUP_REC *rec);
|
|
|
|
void server_setup_remove(SERVER_SETUP_REC *rec);
|
|
|
|
|
|
|
|
void servers_setup_init(void);
|
|
|
|
void servers_setup_deinit(void);
|
|
|
|
|
|
|
|
#endif
|