summaryrefslogtreecommitdiff
path: root/src/irc/proxy/module.h
blob: 1defd0cefee6ffb40b902aec2821c5b6e1b7c4f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "common.h"

#define MODULE_NAME "proxy"

#include "network.h"
#include "line-split.h"
#include "irc-servers.h"

typedef struct {
	int port;
	char *ircnet;

	int tag;
	int handle;
} LISTEN_REC;

typedef struct {
	LINEBUF_REC *buffer;

	char *nick;
	int handle;
	int tag;

	char *proxy_address;
	LISTEN_REC *listen;
	IRC_SERVER_REC *server;
	unsigned int pass_sent:1;
	unsigned int connected:1;
} CLIENT_REC;

extern GSList *proxy_listens;
extern GSList *proxy_clients;

void plugin_proxy_setup_init(void);
void plugin_proxy_setup_deinit(void);

void plugin_proxy_listen_init(void);
void plugin_proxy_listen_deinit(void);

void proxy_settings_init(void);

void plugin_proxy_dump_data(CLIENT_REC *client);

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, ...);
/*void proxy_outserver_all(const char *data, ...);*/
void proxy_outserver_all_except(CLIENT_REC *client, const char *data, ...);