2000-09-29 23:59:51 +00:00
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
|
|
#define MODULE_NAME "proxy"
|
|
|
|
|
|
2000-11-06 02:29:01 +00:00
|
|
|
#include "network.h"
|
|
|
|
|
#include "line-split.h"
|
2001-11-02 14:53:39 +00:00
|
|
|
#include "irc.h"
|
2000-11-06 02:29:01 +00:00
|
|
|
#include "irc-servers.h"
|
2000-09-29 23:59:51 +00:00
|
|
|
|
2000-11-06 02:29:01 +00:00
|
|
|
typedef struct {
|
|
|
|
|
int port;
|
|
|
|
|
char *ircnet;
|
2000-09-29 23:59:51 +00:00
|
|
|
|
2000-11-06 02:29:01 +00:00
|
|
|
int tag;
|
2000-12-05 01:01:53 +00:00
|
|
|
GIOChannel *handle;
|
2002-08-29 19:59:13 +00:00
|
|
|
|
|
|
|
|
GSList *clients;
|
2000-11-06 02:29:01 +00:00
|
|
|
} LISTEN_REC;
|
2000-09-29 23:59:51 +00:00
|
|
|
|
2000-11-06 02:29:01 +00:00
|
|
|
typedef struct {
|
|
|
|
|
LINEBUF_REC *buffer;
|
2000-09-29 23:59:51 +00:00
|
|
|
|
2002-02-08 07:25:51 +00:00
|
|
|
char *nick, *host;
|
2000-12-05 01:01:53 +00:00
|
|
|
GIOChannel *handle;
|
2000-11-06 02:29:01 +00:00
|
|
|
int tag;
|
2000-09-29 23:59:51 +00:00
|
|
|
|
2000-11-09 21:40:22 +00:00
|
|
|
char *proxy_address;
|
2000-11-06 02:29:01 +00:00
|
|
|
LISTEN_REC *listen;
|
|
|
|
|
IRC_SERVER_REC *server;
|
2000-11-23 22:57:59 +00:00
|
|
|
unsigned int pass_sent:1;
|
2001-12-06 15:11:08 +00:00
|
|
|
unsigned int user_sent:1;
|
2000-11-23 22:57:59 +00:00
|
|
|
unsigned int connected:1;
|
2003-10-19 18:56:58 +00:00
|
|
|
unsigned int want_ctcp:1;
|
2000-11-06 02:29:01 +00:00
|
|
|
} CLIENT_REC;
|
2000-09-29 23:59:51 +00:00
|
|
|
|
2000-11-06 02:29:01 +00:00
|
|
|
extern GSList *proxy_listens;
|
|
|
|
|
extern GSList *proxy_clients;
|
2000-09-29 23:59:51 +00:00
|
|
|
|
2001-12-07 15:39:30 +00:00
|
|
|
void proxy_listen_init(void);
|
|
|
|
|
void proxy_listen_deinit(void);
|
2000-11-06 02:29:01 +00:00
|
|
|
|
|
|
|
|
void proxy_settings_init(void);
|
|
|
|
|
|
2001-12-07 15:39:30 +00:00
|
|
|
void proxy_dump_data(CLIENT_REC *client);
|
2001-12-07 15:58:58 +00:00
|
|
|
void proxy_client_reset_nick(CLIENT_REC *client);
|
2000-11-06 02:29:01 +00:00
|
|
|
|
|
|
|
|
void proxy_outdata(CLIENT_REC *client, const char *data, ...);
|
|
|
|
|
void proxy_outdata_all(IRC_SERVER_REC *server, const char *data, ...);
|
|
|
|
|
void proxy_outserver(CLIENT_REC *client, const char *data, ...);
|
2001-10-19 11:28:56 +00:00
|
|
|
void proxy_outserver_all(IRC_SERVER_REC *server, const char *data, ...);
|
2000-11-06 02:29:01 +00:00
|
|
|
void proxy_outserver_all_except(CLIENT_REC *client, const char *data, ...);
|